Fix Inventory#setItem forcing slot 0 for empty items

This commit is contained in:
NichtStudioCode 2023-04-14 00:19:03 +02:00
parent b07cf63736
commit 32ade215cb

@ -558,7 +558,7 @@ public abstract class Inventory {
*/ */
public boolean setItem(@Nullable UpdateReason updateReason, int slot, @Nullable ItemStack itemStack) { public boolean setItem(@Nullable UpdateReason updateReason, int slot, @Nullable ItemStack itemStack) {
if (ItemUtils.isEmpty(itemStack)) if (ItemUtils.isEmpty(itemStack))
return forceSetItem(updateReason, 0, null); return forceSetItem(updateReason, slot, null);
int maxStackSize = getMaxSlotStackSize(slot, itemStack); int maxStackSize = getMaxSlotStackSize(slot, itemStack);
if (itemStack.getAmount() > maxStackSize) if (itemStack.getAmount() > maxStackSize)