aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0983-check-if-itemstack-is-stackable-first.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-04-26 10:45:00 +0200
committerNassim Jahnke <[email protected]>2024-04-26 10:45:00 +0200
commit813cfbf2b0c31f3468554cd6fd87bad5af03259c (patch)
tree248bb64d270c4822256a1db031b4a25dee20fe51 /patches/server/0983-check-if-itemstack-is-stackable-first.patch
parent7e9da43b33aab434a49743e7bc5e969a7bf3e7d2 (diff)
downloadPaper-813cfbf2b0c31f3468554cd6fd87bad5af03259c.tar.gz
Paper-813cfbf2b0c31f3468554cd6fd87bad5af03259c.zip
Fix compile issues
Diffstat (limited to 'patches/server/0983-check-if-itemstack-is-stackable-first.patch')
-rw-r--r--patches/server/0983-check-if-itemstack-is-stackable-first.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/patches/server/0983-check-if-itemstack-is-stackable-first.patch b/patches/server/0983-check-if-itemstack-is-stackable-first.patch
new file mode 100644
index 0000000000..6143642997
--- /dev/null
+++ b/patches/server/0983-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 1e77482a98869e464c1f0a873cff8febf7924c8c..ca7fbe4f8c1e1d2fb90095aa35be4dda3029c23e 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