From cfc8b4ad5e820bb6a1017096c906bbca69f4a476 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Tue, 30 Jun 2020 11:43:15 +1000 Subject: [PATCH] SPIGOT-5887: ClickType doesn't include off hand swaps By: md_5 --- paper-server/nms-patches/PlayerConnection.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/nms-patches/PlayerConnection.patch b/paper-server/nms-patches/PlayerConnection.patch index 5a557edda0..3e77187ab5 100644 --- a/paper-server/nms-patches/PlayerConnection.patch +++ b/paper-server/nms-patches/PlayerConnection.patch @@ -1310,8 +1310,8 @@ + } + break; + case SWAP: -+ if (packetplayinwindowclick.d() >= 0 && packetplayinwindowclick.d() < 9) { -+ click = ClickType.NUMBER_KEY; ++ if ((packetplayinwindowclick.d() >= 0 && packetplayinwindowclick.d() < 9) || packetplayinwindowclick.d() == 40) { ++ click = (packetplayinwindowclick.d() == 40) ? ClickType.SWAP_OFFHAND : ClickType.NUMBER_KEY; + Slot clickedSlot = this.player.activeContainer.getSlot(packetplayinwindowclick.c()); + if (clickedSlot.isAllowed(player)) { + ItemStack hotbar = this.player.inventory.getItem(packetplayinwindowclick.d());