mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-01-19 05:51:23 +01:00
Don't try and drop stacks of 0.
This commit is contained in:
parent
306e67d583
commit
b6046820bf
@ -76,7 +76,8 @@ public class EntityListeners implements Listener {
|
|||||||
|
|
||||||
ItemStack item = event.getEntity().getItemStack();
|
ItemStack item = event.getEntity().getItemStack();
|
||||||
int amount = (stack.getAmount() - 1) + item.getAmount();
|
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())
|
if (amount > item.getMaxStackSize())
|
||||||
UltimateStacker.updateItemAmount(event.getEntity(), amount);
|
UltimateStacker.updateItemAmount(event.getEntity(), amount);
|
||||||
event.getEntity().setItemStack(item);
|
event.getEntity().setItemStack(item);
|
||||||
|
Loading…
Reference in New Issue
Block a user