From 90f7dd5b0f2b97ccf9f3d2ea8c368e9c94b7b39e Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Sun, 19 Feb 2017 16:16:34 +0100 Subject: [PATCH] No need to use the workaround anymore as CB adds large itemstacks properly now --- src/main/java/com/Acrobot/Breeze/Utils/InventoryUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } /**