From b6046820bfa2cea52b5c1afc873914abc047366f Mon Sep 17 00:00:00 2001 From: Brianna Date: Wed, 26 Aug 2020 08:24:18 -0500 Subject: [PATCH] Don't try and drop stacks of 0. --- .../com/songoda/ultimatestacker/listeners/EntityListeners.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/ultimatestacker/listeners/EntityListeners.java b/src/main/java/com/songoda/ultimatestacker/listeners/EntityListeners.java index e95bb07..6ef0884 100644 --- a/src/main/java/com/songoda/ultimatestacker/listeners/EntityListeners.java +++ b/src/main/java/com/songoda/ultimatestacker/listeners/EntityListeners.java @@ -76,7 +76,8 @@ public class EntityListeners implements Listener { 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 < 1) return; + item.setAmount(Math.min(amount, item.getMaxStackSize())); if (amount > item.getMaxStackSize()) UltimateStacker.updateItemAmount(event.getEntity(), amount); event.getEntity().setItemStack(item);