Search in sources :

Example 1 with ClientPlayerChangeHeldItemPacket

use of com.github.steveice10.mc.protocol.packet.ingame.client.player.ClientPlayerChangeHeldItemPacket in project CyanBot by XjCyan1de.

the class CommandSelectSlot method createButton.

public void createButton(JPanel jPanel, int slot) {
    JButton slotButton = new JButton();
    slotButton.setText("Слот " + slot);
    slotButton.addActionListener(e -> {
        final Bot[] selectedBots = Main.getMainFrame().getSelectedBots();
        for (Bot selectedBot : selectedBots) {
            selectedBot.sendPacket(new ClientPlayerChangeHeldItemPacket(slot));
        }
    });
    jPanel.add(slotButton, new GridConstraints(slot, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
Also used : ClientPlayerChangeHeldItemPacket(com.github.steveice10.mc.protocol.packet.ingame.client.player.ClientPlayerChangeHeldItemPacket) GridConstraints(com.intellij.uiDesigner.core.GridConstraints) Bot(me.xjcyan1de.cyanbot.Bot)

Aggregations

ClientPlayerChangeHeldItemPacket (com.github.steveice10.mc.protocol.packet.ingame.client.player.ClientPlayerChangeHeldItemPacket)1 GridConstraints (com.intellij.uiDesigner.core.GridConstraints)1 Bot (me.xjcyan1de.cyanbot.Bot)1