Fix for egg drop amount.

This commit is contained in:
Brianna 2019-10-16 18:42:16 -04:00
parent 1af4f54a6a
commit 50e4cdef31
1 changed files with 3 additions and 0 deletions

View File

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