diff --git a/com/Acrobot/Breeze/Utils/InventoryUtil.java b/com/Acrobot/Breeze/Utils/InventoryUtil.java index 30dd0f4..e04cb7f 100644 --- a/com/Acrobot/Breeze/Utils/InventoryUtil.java +++ b/com/Acrobot/Breeze/Utils/InventoryUtil.java @@ -85,13 +85,17 @@ public class InventoryUtil { public static boolean fits(ItemStack item, Inventory inventory) { int left = item.getAmount(); + if (inventory.getMaxStackSize() == Integer.MAX_VALUE) { + return true; + } + for (ItemStack iStack : inventory.getContents()) { if (left <= 0) { return true; } if (MaterialUtil.isEmpty(iStack)) { - left -= inventory.getMaxStackSize(); + left -= item.getMaxStackSize(); continue; } diff --git a/com/Acrobot/ChestShop/Listeners/PostTransaction/ItemManager.java b/com/Acrobot/ChestShop/Listeners/PostTransaction/ItemManager.java index f4df7d2..990fc87 100644 --- a/com/Acrobot/ChestShop/Listeners/PostTransaction/ItemManager.java +++ b/com/Acrobot/ChestShop/Listeners/PostTransaction/ItemManager.java @@ -46,7 +46,7 @@ public class ItemManager implements Listener { private static void addItems(Inventory inventory, ItemStack[] items) { for (ItemStack item : items) { - inventory.addItem(item.clone()); + InventoryUtil.add(item, inventory); } } } diff --git a/plugin.yml b/plugin.yml index 9028d4a..601e41c 100644 --- a/plugin.yml +++ b/plugin.yml @@ -2,7 +2,7 @@ name: ChestShop main: com.Acrobot.ChestShop.ChestShop -version: 3.50t0034 +version: 3.50t0035 #for CButD dev-url: http://dev.bukkit.org/server-mods/chestshop/