diff options
author | J10a1n15 <45315647+j10a1n15@users.noreply.github.com> | 2024-10-06 10:58:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-06 10:58:03 +0200 |
commit | a07ad3ee5b80d214fa62583817309f1ddc1c2c64 (patch) | |
tree | 5e5df7acfd3133926e2f07bd16c6b228d10bbe47 /src | |
parent | df1bff9338410828ec566f28483dee0938463165 (diff) | |
download | skyhanni-a07ad3ee5b80d214fa62583817309f1ddc1c2c64.tar.gz skyhanni-a07ad3ee5b80d214fa62583817309f1ddc1c2c64.tar.bz2 skyhanni-a07ad3ee5b80d214fa62583817309f1ddc1c2c64.zip |
Fix: Powder Tracker IndexOutOfBoundsException (#2678)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderChestReward.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt | 32 |
2 files changed, 25 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderChestReward.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderChestReward.kt index 1a48a661a..ac824abd3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderChestReward.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderChestReward.kt @@ -115,6 +115,8 @@ enum class PowderChestReward(val displayName: String, pattern: String) { "§9FTX 3070", " {4}§r§9FTX 3070(?: §r§8x(?<amount>.*))?", ), + + // TODO: Fix typo ELECTRON_TRANSIMTTER( "§9Electron Transmitter", " {4}§r§9Electron Transmitter(?: §r§8x(?<amount>.*))?", diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt index 38779224c..4c27f195a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt @@ -140,8 +140,7 @@ object PowderTracker { } } - private val tracker = - SkyHanniTracker("Powder Tracker", { Data() }, { it.powderTracker }) { formatDisplay(drawDisplay(it)) } + private val tracker = SkyHanniTracker("Powder Tracker", { Data() }, { it.powderTracker }) { formatDisplay(drawDisplay(it)) } class Data : TrackerData() { @@ -316,13 +315,11 @@ object PowderTracker { addSearchString("§d${data.totalChestPicked.addSeparators()} Total Chests Picked §7($chestPerHour/h)") addSearchString("§bDouble Powder: ${if (doublePowder) "§aActive! §7($powderTimer)" else "§cInactive!"}") - val entries = PowderChestReward.entries val rewards = data.rewards - addPerHour(rewards, entries[0], mithrilInfo) - addPerHour(rewards, entries[1], gemstoneInfo) + addPerHour(rewards, PowderChestReward.GEMSTONE_POWDER, gemstoneInfo) addSearchString("") - addPerHour(rewards, entries[46], diamondEssenceInfo) - addPerHour(rewards, entries[47], goldEssenceInfo) + addPerHour(rewards, PowderChestReward.DIAMOND_ESSENCE, diamondEssenceInfo) + addPerHour(rewards, PowderChestReward.GOLD_ESSENCE, goldEssenceInfo) addSearchString("") val hardStonePerHour = format(hardStoneInfo.perHour) addSearchString("§b${data.totalHardStoneCompacted.addSeparators()} §fHard Stone §bCompacted §7($hardStonePerHour/h)", "Hard Stone") @@ -347,7 +344,14 @@ object PowderTracker { } var totalParts = 0L - for (reward in entries.subList(26, 32)) { // robots part + for (reward in listOf( + PowderChestReward.FTX_3070, + PowderChestReward.ELECTRON_TRANSIMTTER, + PowderChestReward.ROBOTRON_REFLECTOR, + PowderChestReward.SUPERLITE_MOTOR, + PowderChestReward.CONTROL_SWITCH, + PowderChestReward.SYNTHETIC_HEART, + )) { val count = rewards.getOrDefault(reward, 0) totalParts += count val name = reward.displayName @@ -362,7 +366,17 @@ object PowderTracker { val blueEgg = rewards.getOrDefault(PowderChestReward.BLUE_GOBLIN_EGG, 0) addSearchString("§3$blueEgg§7-§c$redEgg§7-§e$yellowEgg§f-§a$greenEgg§f-§9$goblinEgg §fGoblin Egg") - for (reward in entries.subList(37, 46)) { + for (reward in listOf( + PowderChestReward.WISHING_COMPASS, + PowderChestReward.SLUDGE_JUICE, + PowderChestReward.ASCENSION_ROPE, + PowderChestReward.TREASURITE, + PowderChestReward.JUNGLE_HEART, + PowderChestReward.PICKONIMBUS_2000, + PowderChestReward.YOGGIE, + PowderChestReward.PREHISTORIC_EGG, + PowderChestReward.OIL_BARREL, + )) { val count = rewards.getOrDefault(reward, 0).addSeparators() val name = reward.displayName addSearchString("§b$count $name", name) |