From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: granny 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 39e536d5a9a6fb2cb7654bba8828bdb2c49425dd..36ba57e95b84f3d598bf4be624d6c88b05a6f9a6 100644 --- a/src/main/java/net/minecraft/world/entity/player/Inventory.java +++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java @@ -110,7 +110,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