From e09dbecab8c9ea2ef9d3638e07c6f9f303c16f3b Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 30 Jun 2020 11:43:15 +1000 Subject: [PATCH] SPIGOT-5887: ClickType doesn't include off hand swaps --- nms-patches/PlayerConnection.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch index 5a557edda0..3e77187ab5 100644 --- a/nms-patches/PlayerConnection.patch +++ b/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());