diff options
author | Nassim Jahnke <[email protected]> | 2024-10-27 09:43:00 +0100 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-10-27 10:03:59 +0100 |
commit | 348c8550967380d9843e365e769f67eee8a8e474 (patch) | |
tree | 185991293a5343239e1107ebc98df37de3d020a5 /patches/server/0965-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch | |
parent | bcf52fe5fd7b178e3c72f53762c8e32ca7910dc4 (diff) | |
download | Paper-348c8550967380d9843e365e769f67eee8a8e474.tar.gz Paper-348c8550967380d9843e365e769f67eee8a8e474.zip |
Readd last API patch (with TODO)
Diffstat (limited to 'patches/server/0965-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch')
-rw-r--r-- | patches/server/0965-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/patches/server/0965-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch b/patches/server/0965-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch new file mode 100644 index 0000000000..3fc9866acf --- /dev/null +++ b/patches/server/0965-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Sat, 25 May 2024 09:51:13 -0700 +Subject: [PATCH] Deprecate InvAction#HOTBAR_MOVE_AND_READD + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index b7ff8607cd33d8e6bdab9533792cf43a434210bd..52eafd99ed63f5fc9596225cf45175b1287f20a1 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -3022,14 +3022,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + Slot clickedSlot = this.player.containerMenu.getSlot(packet.getSlotNum()); + if (clickedSlot.mayPickup(this.player)) { + ItemStack hotbar = this.player.getInventory().getItem(packet.getButtonNum()); +- boolean canCleanSwap = hotbar.isEmpty() || (clickedSlot.container == this.player.getInventory() && clickedSlot.mayPlace(hotbar)); // the slot will accept the hotbar item +- if (clickedSlot.hasItem()) { +- if (canCleanSwap) { +- action = InventoryAction.HOTBAR_SWAP; +- } else { +- action = InventoryAction.HOTBAR_MOVE_AND_READD; +- } +- } else if (!clickedSlot.hasItem() && !hotbar.isEmpty() && clickedSlot.mayPlace(hotbar)) { ++ if ((!hotbar.isEmpty() && clickedSlot.mayPlace(hotbar)) || (hotbar.isEmpty() && clickedSlot.hasItem())) { // Paper - modernify this logic (no such thing as a "hotbar move and readd" + action = InventoryAction.HOTBAR_SWAP; + } else { + action = InventoryAction.NOTHING; |