From a9263a24a55396739e4bbfd7af7119863dc1e953 Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Thu, 22 Feb 2024 21:15:35 +0100 Subject: Added not fully completed tasks in Way to gain SkyBlock Xp menus. #974 --- src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/mixins') diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt index a09d8d923..d855c6e5a 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt @@ -40,7 +40,7 @@ class GuiContainerHook(guiAny: Any) { } fun onMouseClick(slot: Slot?, slotId: Int, clickedButton: Int, clickType: Int, ci: CallbackInfo) { - if (SlotClickEvent(gui, gui.inventorySlots, slot, slotId, clickedButton, clickType).postAndCatch()) ci.cancel() + if (SlotClickEvent(gui, gui.inventorySlots, gui.inventorySlots?.inventory?.takeIf { it.size > slotId && slotId >= 0 }?.get(slotId), slot, slotId, clickedButton, clickType).postAndCatch()) ci.cancel() } fun onDrawScreenAfter( @@ -50,4 +50,4 @@ class GuiContainerHook(guiAny: Any) { ) { if (DrawScreenAfterEvent(mouseX, mouseY, ci).postAndCatch()) ci.cancel() } -} \ No newline at end of file +} -- cgit