/** * Updates which hotbar slot of the player is currently selected */ public void handleHeldItemChange(SPacketHeldItemChange packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); if (InventoryPlayer.isHotbar(packetIn.getHeldItemHotbarIndex())) { this.gameController.player.inventory.currentItem = packetIn.getHeldItemHotbarIndex(); } }
/** * sends the players inventory to himself */ public void syncPlayerInventory(EntityPlayerMP playerIn) { playerIn.sendContainerToPlayer(playerIn.inventoryContainer); playerIn.setPlayerHealthUpdated(); playerIn.connection.sendPacket(new SPacketHeldItemChange(playerIn.inventory.currentItem)); }
/** * Updates which hotbar slot of the player is currently selected */ public void handleHeldItemChange(SPacketHeldItemChange packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); if (InventoryPlayer.isHotbar(packetIn.getHeldItemHotbarIndex())) { this.gameController.thePlayer.inventory.currentItem = packetIn.getHeldItemHotbarIndex(); } }
/** * Updates which hotbar slot of the player is currently selected */ void handleHeldItemChange(SPacketHeldItemChange packetIn);