From eb068f4d7d784239ac17e0de235f37e61da65973 Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 18 May 2024 02:57:18 +0200 Subject: Fix: Volcano Explosivity Display (#1821) --- .../features/nether/VolcanoExplosivityDisplay.kt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/main/java') 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 120f8b914..d5a518e67 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/VolcanoExplosivityDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/VolcanoExplosivityDisplay.kt @@ -16,22 +16,20 @@ class VolcanoExplosivityDisplay { private val config get() = SkyHanniMod.feature.crimsonIsle private val patternGroup = RepoPattern.group("crimson.volcano") - private val headerPattern by patternGroup.pattern( - "header.tablistline", - "(?:§.)*Volcano Explosivity:(?:[\\S ]+)*" - ) private val statusPattern by patternGroup.pattern( - "status.tablistline", - " *(?(?:§.)*\\S+)" + "tablistline", + " *Volcano: (?(?:§.)*\\S+)" ) private var display = "" @SubscribeEvent fun onTabListUpdate(event: TabListUpdateEvent) { if (!isEnabled()) return - val text = event.tabList.nextAfter({ headerPattern.matches(it) }) ?: return - statusPattern.matchMatcher(text) { - display = "§bVolcano Explosivity§7: ${group("status")}" + for (line in event.tabList) { + statusPattern.matchMatcher(line) { + display = "§bVolcano Explosivity§7: ${group("status")}" + break + } } } -- cgit