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 --- .../hannibal2/skyhanni/features/summonings/SummoningMobManager.kt | 7 ++----- .../hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/summonings') diff --git a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt index faac1563b..56f490e9b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt @@ -12,7 +12,6 @@ import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.client.event.RenderLivingEvent import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent class SummoningMobManager { @@ -61,14 +60,12 @@ class SummoningMobManager { } } - var tick = 0 - @SubscribeEvent - fun onTick(event: TickEvent.ClientTickEvent) { + fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return if (SkyHanniMod.feature.summonings.summoningMobDisplay) { - if (tick++ % 20 == 0) { + if (event.isMod(20)) { updateData() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt index aeb434170..5bf3b1a3d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.summonings import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.EntityUtils.getNameTagWith @@ -15,7 +16,6 @@ import net.minecraft.entity.EntityLiving import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent class SummoningSoulsName { @@ -31,7 +31,7 @@ class SummoningSoulsName { private val mobsName = mutableMapOf() @SubscribeEvent - fun onTick(event: TickEvent.ClientTickEvent) { + fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return //TODO use packets instead of this -- cgit