From a2ea62c88e4b7d25b27ccfde3d4d94d39c0a419f Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 25 Jul 2023 04:15:38 +0200 Subject: We do love LorenzTickEvent now --- .../at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/chat') diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt index e2eae78f7..7403d2cb6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.chat import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.LocationUtils @@ -11,21 +12,19 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.getLorenzVec import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent class PlayerDeathMessages { - private var tick = 0 private val lastTimePlayerSeen = mutableMapOf() //§c ☠ §r§7§r§bZeroHazel§r§7 was killed by §r§8§lAshfang§r§7§r§7. private val deathMessagePattern = "§c ☠ §r§7§r§.(?.+)§r§7 (?.+)".toPattern() @SubscribeEvent - fun onTick(event: TickEvent.ClientTickEvent) { + fun onTick(event: LorenzTickEvent) { if (!isHideFarDeathsEnabled()) return - if (tick++ % 20 == 0) { + if (event.isMod(20)) { checkOtherPlayers() } } -- cgit