diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-16 13:07:29 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-16 13:07:29 +0100 |
commit | bdbfcdc609a770f765f37d67c9d1e9757c83b7d4 (patch) | |
tree | 20da572327a69b06351ab6d63af656df3b78af6e /src/main/java/at/hannibal2/skyhanni/features | |
parent | cc1be73101abe20c61e25206875b279145883109 (diff) | |
download | skyhanni-bdbfcdc609a770f765f37d67c9d1e9757c83b7d4.tar.gz skyhanni-bdbfcdc609a770f765f37d67c9d1e9757c83b7d4.tar.bz2 skyhanni-bdbfcdc609a770f765f37d67c9d1e9757c83b7d4.zip |
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt index 4bb2120b4..02644a370 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt @@ -21,26 +21,13 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Pattern object VerminTracker { - private val silverfishPattern by RepoPattern.pattern( - "rift.area.westvillage.vermintracker.silverfish", - ".*§eYou vacuumed a §.*Silverfish.*" - ) - private val spiderPattern by RepoPattern.pattern( - "rift.area.westvillage.vermintracker.spider", - ".*§eYou vacuumed a §.*Spider.*" - ) - private val flyPattern by RepoPattern.pattern( - "rift.area.westvillage.vermintracker.fly", - ".*§eYou vacuumed a §.*Fly.*" - ) - private val verminBinPattern by RepoPattern.pattern( - "rift.area.westvillage.vermintracker.binline", - "§fVermin Bin: §\\w(?<count>\\d+) (?<vermin>\\w+)" - ) - private val verminBagPattern by RepoPattern.pattern( - "rift.area.westvillage.vermintracker.bagline", - "§fVacuum Bag: §\\w(?<count>\\d+) (?<vermin>\\w+)" - ) + + private val group = RepoPattern.group("rift.area.westvillage.vermintracker") + private val silverfishPattern by group.pattern("silverfish", ".*§eYou vacuumed a §.*Silverfish.*") + private val spiderPattern by group.pattern("spider", ".*§eYou vacuumed a §.*Spider.*") + private val flyPattern by group.pattern("fly", ".*§eYou vacuumed a §.*Fly.*") + private val verminBinPattern by group.pattern("binline", "§fVermin Bin: §\\w(?<count>\\d+) (?<vermin>\\w+)") + private val verminBagPattern by group.pattern("bagline", "§fVacuum Bag: §\\w(?<count>\\d+) (?<vermin>\\w+)") private val config get() = RiftAPI.config.area.westVillage.verminTracker @@ -92,7 +79,7 @@ object VerminTracker { VerminType.entries.forEach { addVermin(it, bagCounts[it] ?: 0) } } - private fun countVermin(lore: List<String>, pattern: Pattern): MutableMap<VerminTracker.VerminType, Int> { + private fun countVermin(lore: List<String>, pattern: Pattern): Map<VerminType, Int> { val verminCounts = mutableMapOf( VerminType.SILVERFISH to 0, VerminType.SPIDER to 0, @@ -138,7 +125,7 @@ object VerminTracker { fun onRenderOverlay(event: GuiRenderEvent) { if (!isEnabled()) return - tracker.renderDisplay(config.pos) + tracker.renderDisplay(config.position) } fun resetCommand(args: Array<String>) { |