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));
}
Aggregations