diff options
author | Empa <42304516+ItsEmpa@users.noreply.github.com> | 2024-04-25 08:50:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-25 08:50:31 +0200 |
commit | 3d2e244b69dd26977eef2187cc90ed9289c4735d (patch) | |
tree | 943e3ab0bba36c65ad7c8a9c5a9dd4983e036443 /src/main/java/at/hannibal2 | |
parent | 9f7ef2b05adaf526300018bf8fb4f42ca081c483 (diff) | |
download | skyhanni-3d2e244b69dd26977eef2187cc90ed9289c4735d.tar.gz skyhanni-3d2e244b69dd26977eef2187cc90ed9289c4735d.tar.bz2 skyhanni-3d2e244b69dd26977eef2187cc90ed9289c4735d.zip |
Fix: Cold Overlay Pattern (#1540)
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt | 14 |
1 files changed, 13 insertions, 1 deletions
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§.(?<name>.+)§r§7 (?<reason>.+)" ) 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 |