aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityRabbitTheFishChecker.kt7
1 files 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
}
}