From b6042c868fe1643e191b06587d917d86f59e52b1 Mon Sep 17 00:00:00 2001 From: Ghzdude <44148655+ghzdude@users.noreply.github.com> Date: Fri, 16 Feb 2024 10:31:08 -0700 Subject: [PATCH] Fix Crash when Clicking on a non-slot with a stack in hand (#53) * fix a crash when clicking in the gui with an item on anything that's not a slot, * handle -1 slotid when quick moving --- .../com/cleanroommc/modularui/screen/ModularContainer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/cleanroommc/modularui/screen/ModularContainer.java b/src/main/java/com/cleanroommc/modularui/screen/ModularContainer.java index 998794ec..685f052b 100644 --- a/src/main/java/com/cleanroommc/modularui/screen/ModularContainer.java +++ b/src/main/java/com/cleanroommc/modularui/screen/ModularContainer.java @@ -189,6 +189,9 @@ public boolean canInteractWith(@NotNull EntityPlayer playerIn) { } return inventoryplayer.getItemStack(); } + + if (slotId < 0) return ItemStack.EMPTY; + if (clickTypeIn == ClickType.QUICK_MOVE) { Slot fromSlot = getSlot(slotId);