diff --git a/src/main/java/com/songoda/ultimatestacker/listeners/EntityListeners.java b/src/main/java/com/songoda/ultimatestacker/listeners/EntityListeners.java index affb414..6d4b9bc 100644 --- a/src/main/java/com/songoda/ultimatestacker/listeners/EntityListeners.java +++ b/src/main/java/com/songoda/ultimatestacker/listeners/EntityListeners.java @@ -70,7 +70,10 @@ public class EntityListeners implements Listener { EntityStack stack = stackManager.getStack(entity); ItemStack item = event.getEntity().getItemStack(); + int amount = (stack.getAmount() - 1) + item.getAmount(); item.setAmount(Math.min((stack.getAmount() - 1) + item.getAmount(), item.getMaxStackSize())); + if (amount > item.getMaxStackSize()) + UltimateStacker.updateItemAmount(event.getEntity(), amount); event.getEntity().setItemStack(item); }