aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cole <40234707+DavidArthurCole@users.noreply.github.com>2024-10-21 17:01:06 -0400
committerGitHub <noreply@github.com>2024-10-21 23:01:06 +0200
commitbf62b5d970af839087e56ce7b1254cbf48664898 (patch)
treea833fdbeca137aa0e9503b2d248948ea6debc0e8
parentc69aee1a6ffd8c677cc6c3ed1d3628c781fd7fe7 (diff)
downloadSkyHanni-bf62b5d970af839087e56ce7b1254cbf48664898.tar.gz
SkyHanni-bf62b5d970af839087e56ce7b1254cbf48664898.tar.bz2
SkyHanni-bf62b5d970af839087e56ce7b1254cbf48664898.zip
Fix: Rabbit the Fish Indexing Error (#2785)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
-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
}
}