summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/chat
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-25 04:15:38 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-25 04:15:38 +0200
commita2ea62c88e4b7d25b27ccfde3d4d94d39c0a419f (patch)
tree3771b517ce72fe5c9a8b7e7020d15cafdf3a36b8 /src/main/java/at/hannibal2/skyhanni/features/chat
parentde61fd6bccbea2a3ceca5a0707a3176938f24ead (diff)
downloadskyhanni-a2ea62c88e4b7d25b27ccfde3d4d94d39c0a419f.tar.gz
skyhanni-a2ea62c88e4b7d25b27ccfde3d4d94d39c0a419f.tar.bz2
skyhanni-a2ea62c88e4b7d25b27ccfde3d4d94d39c0a419f.zip
We do love LorenzTickEvent now
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/chat')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt7
1 files changed, 3 insertions, 4 deletions
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<String, Long>()
//§c ☠ §r§7§r§bZeroHazel§r§7 was killed by §r§8§lAshfang§r§7§r§7.
private val deathMessagePattern = "§c ☠ §r§7§r§.(?<name>.+)§r§7 (?<reason>.+)".toPattern()
@SubscribeEvent
- fun onTick(event: TickEvent.ClientTickEvent) {
+ fun onTick(event: LorenzTickEvent) {
if (!isHideFarDeathsEnabled()) return
- if (tick++ % 20 == 0) {
+ if (event.isMod(20)) {
checkOtherPlayers()
}
}