Don't try and drop stacks of 0.

This commit is contained in:
Brianna 2020-08-26 08:24:18 -05:00
parent 306e67d583
commit b6046820bf
1 changed files with 2 additions and 1 deletions

View File

@ -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);