mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01:00
check if itemstack is stackable first
This commit is contained in:
parent
84d07ca942
commit
826f299f4c
1 changed files with 6 additions and 2 deletions
|
@ -69,8 +69,12 @@
|
|||
public Inventory(Player player) {
|
||||
this.items = NonNullList.withSize(36, ItemStack.EMPTY);
|
||||
this.armor = NonNullList.withSize(4, ItemStack.EMPTY);
|
||||
@@ -59,6 +113,28 @@
|
||||
return !existingStack.isEmpty() && ItemStack.isSameItemSameComponents(existingStack, stack) && existingStack.isStackable() && existingStack.getCount() < this.getMaxStackSize(existingStack);
|
||||
@@ -56,9 +110,31 @@
|
||||
}
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue