Use Bukkit's addItem method if maxStackSize equals the item's natural stack size
This commit is contained in:
parent
90f7dd5b0f
commit
765548e0e5
|
@ -137,6 +137,10 @@ public class InventoryUtil {
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (maxStackSize == item.getMaxStackSize()) {
|
||||
return add(item, inventory);
|
||||
}
|
||||
|
||||
int amountLeft = item.getAmount();
|
||||
|
||||
for (int currentSlot = 0; currentSlot < effectiveSize(inventory) && amountLeft > 0; currentSlot++) {
|
||||
|
|
Loading…
Reference in New Issue