diff --git a/src/main/java/com/Acrobot/Breeze/Utils/InventoryUtil.java b/src/main/java/com/Acrobot/Breeze/Utils/InventoryUtil.java index 7dd43ae..1d0a626 100644 --- a/src/main/java/com/Acrobot/Breeze/Utils/InventoryUtil.java +++ b/src/main/java/com/Acrobot/Breeze/Utils/InventoryUtil.java @@ -126,7 +126,6 @@ public class InventoryUtil { /** * Adds an item to the inventory with given maximum stack size - * (it currently uses a custom method of adding items, because Bukkit hasn't fixed it for a year now - not even kidding) * * @param item Item to add * @param inventory Inventory @@ -181,7 +180,9 @@ public class InventoryUtil { * @return Number of leftover items */ public static int add(ItemStack item, Inventory inventory) { - return add(item, inventory, item.getMaxStackSize()); + Map leftovers = inventory.addItem(item.clone()); // item needs to be cloned as cb changes the amount of the stack size + + return countItems(leftovers); } /**