From 32ade215cba6d08df4bd8f3e1ae9acf66de08315 Mon Sep 17 00:00:00 2001 From: NichtStudioCode <51272202+NichtStudioCode@users.noreply.github.com> Date: Fri, 14 Apr 2023 00:19:03 +0200 Subject: [PATCH] Fix Inventory#setItem forcing slot 0 for empty items --- .../src/main/java/xyz/xenondevs/invui/inventory/Inventory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invui/src/main/java/xyz/xenondevs/invui/inventory/Inventory.java b/invui/src/main/java/xyz/xenondevs/invui/inventory/Inventory.java index dc15924..812fef5 100644 --- a/invui/src/main/java/xyz/xenondevs/invui/inventory/Inventory.java +++ b/invui/src/main/java/xyz/xenondevs/invui/inventory/Inventory.java @@ -558,7 +558,7 @@ public abstract class Inventory { */ public boolean setItem(@Nullable UpdateReason updateReason, int slot, @Nullable ItemStack itemStack) { if (ItemUtils.isEmpty(itemStack)) - return forceSetItem(updateReason, 0, null); + return forceSetItem(updateReason, slot, null); int maxStackSize = getMaxSlotStackSize(slot, itemStack); if (itemStack.getAmount() > maxStackSize)