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 | |
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')
3 files changed, 18 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/winter/FrozenTreasureConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/winter/FrozenTreasureConfig.java index a1f378d08..6ed609948 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/winter/FrozenTreasureConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/winter/FrozenTreasureConfig.java @@ -61,7 +61,7 @@ public class FrozenTreasureConfig { )); public enum FrozenTreasureDisplayEntry implements HasLegacyId { - TITLE("§1§lFrozen Treasure Tracker", 0), + TITLE("§e§lFrozen Treasure Tracker", 0), TREASURES_MINED("§61,636 Treasures Mined", 1), TOTAL_ICE("§33.2m Total Ice", 2), ICE_PER_HOUR("§3342,192 Ice/hr", 3), @@ -77,6 +77,8 @@ public class FrozenTreasureConfig { GLOWY_CHUM_BAIT("§b3 §aGlowy Chum Bait", 13), GLACIAL_FRAGMENT("§b36 §5Glacial Fragment", 14), GLACIAL_TALISMAN("§b6 §fGlacial Talisman", 15), + FROZEN_BAIT("§b20 §9Frozen Bait"), + EINARY_RED_HOODIE("§b1 §cEinary's Red Hoodie"), SPACER_2(" ", 16); private final String str; 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" } } |