Fix item overflow issue with kits & trade signs

This commit is contained in:
JRoy 2025-02-27 21:54:27 -05:00 committed by Josh Roy
parent ba5257c8e6
commit e49021fffe
2 changed files with 4 additions and 4 deletions

View File

@ -242,10 +242,10 @@ public class Kit {
for (final ItemStack itemStack : leftover.values()) {
int spillAmount = itemStack.getAmount();
if (maxStackSize != 0) {
itemStack.setAmount(Math.min(spillAmount, itemStack.getMaxStackSize()));
}
while (spillAmount > 0) {
if (maxStackSize != 0) {
itemStack.setAmount(Math.min(spillAmount, itemStack.getMaxStackSize()));
}
user.getWorld().dropItemNaturally(user.getLocation(), itemStack);
spillAmount -= itemStack.getAmount();
}

View File

@ -242,8 +242,8 @@ public class Trade {
} else {
for (final ItemStack itemStack : leftover.values()) {
int spillAmount = itemStack.getAmount();
itemStack.setAmount(Math.min(spillAmount, itemStack.getMaxStackSize()));
while (spillAmount > 0) {
itemStack.setAmount(Math.min(spillAmount, itemStack.getMaxStackSize()));
user.getBase().getWorld().dropItemNaturally(user.getBase().getLocation(), itemStack);
spillAmount -= itemStack.getAmount();
}