From bf62b5d970af839087e56ce7b1254cbf48664898 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Mon, 21 Oct 2024 17:01:06 -0400 Subject: Fix: Rabbit the Fish Indexing Error (#2785) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../skyhanni/features/event/hoppity/HoppityRabbitTheFishChecker.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityRabbitTheFishChecker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityRabbitTheFishChecker.kt index 3565c1778..02e800dcc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityRabbitTheFishChecker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityRabbitTheFishChecker.kt @@ -55,9 +55,8 @@ object HoppityRabbitTheFishChecker { fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { if (!isEnabled()) return - rabbitTheFishIndex?.let { - InventoryUtils.getItemsInOpenChest()[it] highlight LorenzColor.RED - } + val index = rabbitTheFishIndex ?: return + InventoryUtils.getItemsInOpenChest().firstOrNull { it.slotIndex == index }?.highlight(LorenzColor.RED) } @SubscribeEvent @@ -80,7 +79,7 @@ object HoppityRabbitTheFishChecker { if (openCfSlotLorePattern.anyMatches(stack.getLore())) { event.cancel() SoundUtils.playErrorSound() - } else if (rabbitTheFishIndex == event.slot.slotNumber) { + } else if (rabbitTheFishIndex == event.slot.slotIndex) { rabbitTheFishIndex = null } } -- cgit