aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/rift/area/westvillage/VerminTrackerConfig.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt31
2 files changed, 10 insertions, 23 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/rift/area/westvillage/VerminTrackerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/rift/area/westvillage/VerminTrackerConfig.java
index 1ada3d883..1fa5833d2 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/rift/area/westvillage/VerminTrackerConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/rift/area/westvillage/VerminTrackerConfig.java
@@ -20,6 +20,6 @@ public class VerminTrackerConfig {
public boolean hideChat = false;
@Expose
- public Position pos = new Position(16, -232, false, true);
+ public Position position = new Position(16, -232, false, true);
}
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>) {