diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-04-27 20:17:12 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-27 12:17:12 +0200 |
commit | d674606e0454239bc610330be923486efb19a93b (patch) | |
tree | 58ed819bc2ea3430f222002d10499c01c80e605f | |
parent | cc27e7f7a8b88fe4ce5fc989f23015bdce626452 (diff) | |
download | skyhanni-d674606e0454239bc610330be923486efb19a93b.tar.gz skyhanni-d674606e0454239bc610330be923486efb19a93b.tar.bz2 skyhanni-d674606e0454239bc610330be923486efb19a93b.zip |
Fix: Various SkyHanniRenderEntityEvent things (#1555)
4 files changed, 11 insertions, 31 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/HideDamageSplash.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/HideDamageSplash.kt index 4931449ae..acf4b6075 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/HideDamageSplash.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/HideDamageSplash.kt @@ -12,7 +12,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class HideDamageSplash { @SubscribeEvent(priority = EventPriority.HIGH) - fun onRenderDamage(event: SkyHanniRenderEntityEvent.Specials.Pre<EntityLivingBase>) { + fun onRenderLiving(event: SkyHanniRenderEntityEvent.Specials.Pre<EntityLivingBase>) { if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.combat.hideDamageSplash) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt index cac99316f..4576ebe43 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt @@ -23,7 +23,7 @@ class TeleportPadCompactName { ) @SubscribeEvent(priority = EventPriority.HIGH) - fun onRenderLivingB(event: SkyHanniRenderEntityEvent.Specials.Pre<EntityLivingBase>) { + fun onRenderLiving(event: SkyHanniRenderEntityEvent.Specials.Pre<EntityLivingBase>) { if (!IslandType.PRIVATE_ISLAND.isInIsland()) return if (!SkyHanniMod.feature.misc.teleportPad.compactName) return val entity = event.entity diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/VampireSlayerFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/VampireSlayerFeatures.kt index faf455246..df2ce10a9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/VampireSlayerFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/VampireSlayerFeatures.kt @@ -30,11 +30,7 @@ import at.hannibal2.skyhanni.utils.RenderUtils.drawColor import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import at.hannibal2.skyhanni.utils.RenderUtils.exactLocation import at.hannibal2.skyhanni.utils.RenderUtils.exactPlayerEyeLocation -import at.hannibal2.skyhanni.utils.SoundUtils -import at.hannibal2.skyhanni.utils.SoundUtils.playSound import at.hannibal2.skyhanni.utils.toLorenzVec -import kotlinx.coroutines.delay -import kotlinx.coroutines.launch import net.minecraft.client.Minecraft import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraft.client.renderer.GlStateManager @@ -130,13 +126,11 @@ object VampireSlayerFeatures { if (shouldSendTitle) { DelayedRun.runDelayed(config.twinclawsDelay.milliseconds) { if (nextClawSend < System.currentTimeMillis()) { - if (shouldSendTitle) { - LorenzUtils.sendTitle( - "§6§lTWINCLAWS", - (1750 - config.twinclawsDelay).milliseconds, - 2.6 - ) - } + LorenzUtils.sendTitle( + "§6§lTWINCLAWS", + (1750 - config.twinclawsDelay).milliseconds, + 2.6 + ) nextClawSend = System.currentTimeMillis() + 5_000 } } @@ -242,7 +236,7 @@ object VampireSlayerFeatures { } @SubscribeEvent - fun pre(event: SkyHanniRenderEntityEvent.Pre<EntityOtherPlayerMP>) { + fun onRenderLivingPre(event: SkyHanniRenderEntityEvent.Pre<EntityOtherPlayerMP>) { if (!isEnabled()) return if (!config.seeThrough) return if (entityList.contains(event.entity) && event.entity.canBeSeen()) { @@ -251,7 +245,7 @@ object VampireSlayerFeatures { } @SubscribeEvent - fun post(event: SkyHanniRenderEntityEvent.Post<EntityOtherPlayerMP>) { + fun onRenderLivingPost(event: SkyHanniRenderEntityEvent.Post<EntityOtherPlayerMP>) { if (!isEnabled()) return if (!config.seeThrough) return if (entityList.contains(event.entity) && event.entity.canBeSeen()) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt index 494fe1efa..70fdb6c4e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt @@ -182,14 +182,6 @@ object EntityUtils { fun getEntityByID(entityId: Int) = Minecraft.getMinecraft()?.thePlayer?.entityWorld?.getEntityByID(entityId) @SubscribeEvent - fun onEntityRender(event: RenderLivingEvent<*>) { - val shEvent = SkyHanniRenderEntityEvent(event.entity, event.renderer, event.x, event.y, event.z) - if (shEvent.postAndCatch()) { - event.cancel() - } - } - - @SubscribeEvent fun onEntityRenderPre(event: RenderLivingEvent.Pre<*>) { val shEvent = SkyHanniRenderEntityEvent.Pre(event.entity, event.renderer, event.x, event.y, event.z) if (shEvent.postAndCatch()) { @@ -199,10 +191,7 @@ object EntityUtils { @SubscribeEvent fun onEntityRenderPost(event: RenderLivingEvent.Post<*>) { - val shEvent = SkyHanniRenderEntityEvent.Post(event.entity, event.renderer, event.x, event.y, event.z) - if (shEvent.postAndCatch()) { - event.cancel() - } + SkyHanniRenderEntityEvent.Post(event.entity, event.renderer, event.x, event.y, event.z) } @SubscribeEvent @@ -215,10 +204,7 @@ object EntityUtils { @SubscribeEvent fun onEntityRenderSpecialsPost(event: RenderLivingEvent.Specials.Post<*>) { - val shEvent = SkyHanniRenderEntityEvent.Specials.Post(event.entity, event.renderer, event.x, event.y, event.z) - if (shEvent.postAndCatch()) { - event.cancel() - } + SkyHanniRenderEntityEvent.Specials.Post(event.entity, event.renderer, event.x, event.y, event.z) } fun EntityLivingBase.isCorrupted() = baseMaxHealth == health.toInt().derpy() * 3 || isRunicAndCorrupt() |