aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/nether
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-12-03 19:18:06 -0800
committerGitHub <noreply@github.com>2023-12-04 04:18:06 +0100
commit1cf1f68672d07767ed93150dd32094234eddd70c (patch)
tree6a57fdedca12fc61f688d4f1aa96e120866dc6ad /src/main/java/at/hannibal2/skyhanni/features/nether
parent66fc6034b563b30854de121385d67140f605004e (diff)
downloadskyhanni-1cf1f68672d07767ed93150dd32094234eddd70c.tar.gz
skyhanni-1cf1f68672d07767ed93150dd32094234eddd70c.tar.bz2
skyhanni-1cf1f68672d07767ed93150dd32094234eddd70c.zip
Internal Change: Remove String.matchRegex() function Usages (#641)
Code cleanup and removed .matchRegex() #641
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
index 5fd7a3b77..447884c05 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
@@ -8,13 +8,16 @@ import at.hannibal2.skyhanni.features.combat.damageindicator.BossType
import at.hannibal2.skyhanni.features.combat.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
-import at.hannibal2.skyhanni.utils.StringUtils.matchRegex
+import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.TimeUtils
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class AshfangFreezeCooldown {
private val config get() = SkyHanniMod.feature.crimsonIsle.ashfang
+ // TODO USE SH-REPO
+ private val cryogenicBlastPattern = "§cAshfang Follower's Cryogenic Blast hit you for (.*) damage!".toPattern()
+
private var lastHit = 0L
@SubscribeEvent
@@ -22,7 +25,7 @@ class AshfangFreezeCooldown {
if (!isEnabled()) return
val message = event.message
- if (message.matchRegex("§cAshfang Follower's Cryogenic Blast hit you for (.*) damage!")) {
+ cryogenicBlastPattern.matchMatcher(message) {
lastHit = System.currentTimeMillis()
}
}