diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-24 19:12:00 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-24 19:12:00 +0100 |
commit | cfaae436252ff30828bdffc08a64c89a6f5f18eb (patch) | |
tree | 73ffad49032fe09527a149faf2fad1e586dfc845 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 283f55a2e11d131cfa5a2382253734002ebc4306 (diff) | |
download | skyhanni-cfaae436252ff30828bdffc08a64c89a6f5f18eb.tar.gz skyhanni-cfaae436252ff30828bdffc08a64c89a6f5f18eb.tar.bz2 skyhanni-cfaae436252ff30828bdffc08a64c89a6f5f18eb.zip |
Added Frozen Bait and Einary's Red Hoodie to Frozen Treasure Tracker.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
2 files changed, 15 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasure.kt b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasure.kt index e4670ffcc..de1b9df1a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasure.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasure.kt @@ -1,5 +1,7 @@ package at.hannibal2.skyhanni.features.event.jerry.frozentreasure +import at.hannibal2.skyhanni.utils.StringUtils.removeColor + enum class FrozenTreasure( val internalName: String, val displayName: String, @@ -15,5 +17,10 @@ enum class FrozenTreasure( ICE_BAIT("ICE_BAIT", "§aIce Bait", 16), GLOWY_CHUM_BAIT("GLOWY_CHUM_BAIT", "§aGlowy Chum Bait", 16), GLACIAL_FRAGMENT("GLACIAL_FRAGMENT", "§5Glacial Fragment", 1), - GLACIAL_TALISMAN("GLACIAL_TALISMAN", "§fGlacial Talisman", 1) -}
\ No newline at end of file + GLACIAL_TALISMAN("GLACIAL_TALISMAN", "§fGlacial Talisman", 1), + FROZEN_BAIT("FROZEN_BAIT", "§9Frozen Bait", 1), + EINARY_RED_HOODIE("FROZEN_BAIT", "§cEinary's Red Hoodie", 1), + ; + + val pattern by lazy { "FROZEN TREASURE! You found ${displayName.removeColor()}!".toPattern() } +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt index 63ec4fbf2..7f983a374 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt @@ -16,6 +16,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import at.hannibal2.skyhanni.utils.StringUtils.matches import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.tracker.SkyHanniTracker import at.hannibal2.skyhanni.utils.tracker.TrackerData @@ -118,14 +119,12 @@ object FrozenTreasureTracker { if (config.hideMessages) event.blockedReason = "frozen treasure tracker" } - for (treasure in FrozenTreasure.entries) { - if ("FROZEN TREASURE! You found ${treasure.displayName.removeColor()}!".toRegex().matches(message)) { - tracker.modify { - it.treasuresMined += 1 - it.treasureCount.addOrPut(treasure, 1) - } - if (config.hideMessages) event.blockedReason = "frozen treasure tracker" + for (treasure in FrozenTreasure.entries.filter { it.pattern.matches(message) }) { + tracker.modify { + it.treasuresMined += 1 + it.treasureCount.addOrPut(treasure, 1) } + if (config.hideMessages) event.blockedReason = "frozen treasure tracker" } } |