diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-05-18 02:58:03 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-05-18 02:58:03 +0200 |
commit | dcaeb7a3c5dfeab24377f7556c793ea5c3d5c686 (patch) | |
tree | f3fcea7705eb4f31dd02173ffeae88ab1791b8bf /src/main/java/at/hannibal2/skyhanni/features | |
parent | eb068f4d7d784239ac17e0de235f37e61da65973 (diff) | |
download | skyhanni-dcaeb7a3c5dfeab24377f7556c793ea5c3d5c686.tar.gz skyhanni-dcaeb7a3c5dfeab24377f7556c793ea5c3d5c686.tar.bz2 skyhanni-dcaeb7a3c5dfeab24377f7556c793ea5c3d5c686.zip |
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/VolcanoExplosivityDisplay.kt | 15 |
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")}" } } |