diff options
author | Jake Potrebic <[email protected]> | 2024-07-16 16:39:57 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2024-07-16 16:39:57 -0700 |
commit | 506f1651e549c290142df8d1e2e8ea831bc381c0 (patch) | |
tree | 250f8cb16a8e94a588aa9df694e199f3e45ae824 /patches/server/0985-check-if-itemstack-is-stackable-first.patch | |
parent | a6ceda12c54cd8b7d272fe50e744c9b9a26d0838 (diff) | |
download | Paper-506f1651e549c290142df8d1e2e8ea831bc381c0.tar.gz Paper-506f1651e549c290142df8d1e2e8ea831bc381c0.zip |
Don't store removed components in multiple places (#11091)
Diffstat (limited to 'patches/server/0985-check-if-itemstack-is-stackable-first.patch')
-rw-r--r-- | patches/server/0985-check-if-itemstack-is-stackable-first.patch | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/patches/server/0985-check-if-itemstack-is-stackable-first.patch b/patches/server/0985-check-if-itemstack-is-stackable-first.patch new file mode 100644 index 0000000000..8e11960bdd --- /dev/null +++ b/patches/server/0985-check-if-itemstack-is-stackable-first.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: granny <[email protected]> +Date: Sat, 24 Feb 2024 19:33:01 -0800 +Subject: [PATCH] check if itemstack is stackable first + + +diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java +index a62e7354bf67a66bdf9cd7c8f5d2e8f6bcacc74f..6e66141dca61f777b354854b5d0bac2570b8bf3b 100644 +--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java ++++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java +@@ -111,7 +111,7 @@ public class Inventory implements Container, Nameable { + } + + private boolean hasRemainingSpaceForItem(ItemStack existingStack, ItemStack stack) { +- return !existingStack.isEmpty() && ItemStack.isSameItemSameComponents(existingStack, stack) && existingStack.isStackable() && existingStack.getCount() < this.getMaxStackSize(existingStack); ++ return !existingStack.isEmpty() && existingStack.isStackable() && existingStack.getCount() < this.getMaxStackSize(existingStack) && ItemStack.isSameItemSameComponents(existingStack, stack); // Paper - check if itemstack is stackable first + } + + // CraftBukkit start - Watch method above! :D |