From 3d2e244b69dd26977eef2187cc90ed9289c4735d Mon Sep 17 00:00:00 2001 From: Empa <42304516+ItsEmpa@users.noreply.github.com> Date: Thu, 25 Apr 2024 08:50:31 +0200 Subject: Fix: Cold Overlay Pattern (#1540) --- src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt index 89ebe71d6..45a31fc37 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt @@ -5,9 +5,11 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.ScoreboardChangeEvent import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardPattern +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.StringUtils.matchFirst +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.matches import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -20,7 +22,11 @@ object MiningAPI { private val glaciteAreaPattern by group.pattern("area.glacite", "Glacite Tunnels") val coldReset by group.pattern( "cold.reset", - "§cThe warmth of the campfire reduced your §r§b❄ Cold §r§cto 0!|§c ☠ §r§7You froze to death§r§7." + "§6The warmth of the campfire reduced your §r§b❄ Cold §r§6to §r§a0§r§6!|§c ☠ §r§7You froze to death§r§7." + ) + val coldResetDeath by group.pattern( + "cold.deathreset", + "§c ☠ §r§7§r§.(?.+)§r§7 (?.+)" ) private var cold = 0 @@ -51,6 +57,12 @@ object MiningAPI { updateCold(0) lastColdReset = SimpleTimeMark.now() } + coldResetDeath.matchMatcher(event.message) { + if (group("name") == LorenzUtils.getPlayerName()) { + updateCold(0) + lastColdReset = SimpleTimeMark.now() + } + } } @SubscribeEvent -- cgit