aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/VolcanoExplosivityDisplay.kt15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/VolcanoExplosivityDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/VolcanoExplosivityDisplay.kt
index d5a518e67..4565e6803 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/VolcanoExplosivityDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/VolcanoExplosivityDisplay.kt
@@ -4,11 +4,9 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.TabListUpdateEvent
-import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
-import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
-import at.hannibal2.skyhanni.utils.StringUtils.matches
+import at.hannibal2.skyhanni.utils.StringUtils.matchFirst
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -16,6 +14,10 @@ class VolcanoExplosivityDisplay {
private val config get() = SkyHanniMod.feature.crimsonIsle
private val patternGroup = RepoPattern.group("crimson.volcano")
+
+ /**
+ * REGEX-TEST: Volcano: §r§8INACTIVE
+ */
private val statusPattern by patternGroup.pattern(
"tablistline",
" *Volcano: (?<status>(?:§.)*\\S+)"
@@ -25,11 +27,8 @@ class VolcanoExplosivityDisplay {
@SubscribeEvent
fun onTabListUpdate(event: TabListUpdateEvent) {
if (!isEnabled()) return
- for (line in event.tabList) {
- statusPattern.matchMatcher(line) {
- display = "§bVolcano Explosivity§7: ${group("status")}"
- break
- }
+ event.tabList.matchFirst(statusPattern) {
+ display = "§bVolcano Explosivity§7: ${group("status")}"
}
}