diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-13 16:53:31 +0100 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-13 16:53:31 +0100 |
| commit | 59d0867033bec7a12ab091199aba1b86e88512f5 (patch) | |
| tree | eeb8263eaceea72ffa7e2005b53ab2ce5c010885 /src/main/java/at/hannibal2/skyhanni/features/nether/ashfang | |
| parent | e1e8a06d4b60282540207450ed78a58eb8e42599 (diff) | |
| download | SkyHanni-master.tar.gz SkyHanni-master.tar.bz2 SkyHanni-master.zip | |
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether/ashfang')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt index df242b159..03211eb5b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt @@ -15,23 +15,22 @@ import net.minecraftforge.fml.common.gameevent.TickEvent class AshfangHideParticles { var tick = 0 - var hideParticles = false + private var nearAshfang = false @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { if (!LorenzUtils.inSkyBlock) return if (tick++ % 60 == 0) { - val distance = DamageIndicatorManager.getDistanceTo(BossType.NETHER_ASHFANG) - hideParticles = distance < 40 + nearAshfang = DamageIndicatorManager.getDistanceTo(BossType.NETHER_ASHFANG) < 40 } } @SubscribeEvent fun onReceivePacket(event: ReceiveParticleEvent) { - if (!isEnabled()) return - - event.isCanceled = true + if (isEnabled()) { + event.isCanceled = true + } } @SubscribeEvent(priority = EventPriority.HIGH) @@ -51,5 +50,5 @@ class AshfangHideParticles { } } - private fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.hideParticles && hideParticles + private fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.hideParticles && nearAshfang }
\ No newline at end of file |
