Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server.getPluginManager().callEvent(event);
- switch (event.getResult()) {
- case ALLOW:
- case DEFAULT:
- itemstack = this.player.activeContainer.clickItem(packetplayinwindowclick.d(), packetplayinwindowclick.e(), packetplayinwindowclick.h(), this.player);
- break;
- case DENY:
- /* Needs enum constructor in InventoryAction
- if (action.modifiesOtherSlots()) {
- } else {
- if (action.modifiesCursor()) {
- this.player.playerConnection.sendPacket(new Packet103SetSlot(-1, -1, this.player.inventory.getCarried()));
- }
- if (action.modifiesClicked()) {
- this.player.playerConnection.sendPacket(new Packet103SetSlot(this.player.activeContainer.windowId, packet102windowclick.slot, this.player.activeContainer.getSlot(packet102windowclick.slot).getItem()));
- }
- }*/
- switch (action) {
- // Modified other slots
- case PICKUP_ALL:
- case MOVE_TO_OTHER_INVENTORY:
- case HOTBAR_MOVE_AND_READD:
- case HOTBAR_SWAP:
- case COLLECT_TO_CURSOR:
- case UNKNOWN:
- this.player.updateInventory(this.player.activeContainer);
- break;
- // Modified cursor and clicked
- case PICKUP_SOME:
- case PICKUP_HALF:
- case PICKUP_ONE:
- case PLACE_ALL:
- case PLACE_SOME:
- case PLACE_ONE:
- case SWAP_WITH_CURSOR:
- this.player.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.player.inventory.getCarried()));
- this.player.playerConnection.sendPacket(new PacketPlayOutSetSlot(this.player.activeContainer.windowId, packetplayinwindowclick.d(), this.player.activeContainer.getSlot(packetplayinwindowclick.d()).getItem()));
- break;
- // Modified clicked only
- case DROP_ALL_SLOT:
- case DROP_ONE_SLOT:
- this.player.playerConnection.sendPacket(new PacketPlayOutSetSlot(this.player.activeContainer.windowId, packetplayinwindowclick.d(), this.player.activeContainer.getSlot(packetplayinwindowclick.d()).getItem()));
- break;
- // Modified cursor only
- case DROP_ALL_CURSOR:
- case DROP_ONE_CURSOR:
- case CLONE_STACK:
- this.player.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.player.inventory.getCarried()));
- break;
- // Nothing
- case NOTHING:
- break;
- }
- return;
- }
- }
- // CraftBukkit end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement