diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-10-01 18:33:53 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-10-01 18:33:53 +0200 |
commit | fa46eb546fee0efe2bc41459bdfdde4344ac8ff6 (patch) | |
tree | 17614e622db7e4b58339d83640a18d89cba96ec5 /src/main/java/at/hannibal2/skyhanni/features/nether | |
parent | ad998ebd56c43097154d970e2f34898a53d6444d (diff) | |
download | skyhanni-fa46eb546fee0efe2bc41459bdfdde4344ac8ff6.tar.gz skyhanni-fa46eb546fee0efe2bc41459bdfdde4344ac8ff6.tar.bz2 skyhanni-fa46eb546fee0efe2bc41459bdfdde4344ac8ff6.zip |
hide icons circling around ashfang
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt | 24 |
1 files changed, 21 insertions, 3 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 266ec3da8..0a43f6940 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 @@ -1,11 +1,15 @@ package at.hannibal2.skyhanni.features.nether.ashfang import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.CheckRenderEntityEvent import at.hannibal2.skyhanni.events.PlayParticleEvent import at.hannibal2.skyhanni.events.SpawnParticleEvent import at.hannibal2.skyhanni.features.damageindicator.BossType import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager +import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraft.entity.item.EntityArmorStand +import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.TickEvent @@ -27,7 +31,6 @@ class AshfangHideParticles { @SubscribeEvent fun onReceivePacket(event: PlayParticleEvent) { if (!isEnabled()) return - if (!hideParticles) return event.isCanceled = true } @@ -35,7 +38,6 @@ class AshfangHideParticles { @SubscribeEvent fun onSpawnParticle(event: SpawnParticleEvent) { if (!isEnabled()) return - if (!hideParticles) return when (event.callerClass) { @@ -46,8 +48,24 @@ class AshfangHideParticles { event.isCanceled = true } } + } + + @SubscribeEvent(priority = EventPriority.HIGH) + fun onCheckRender(event: CheckRenderEntityEvent<*>) { + if (!isEnabled()) return + val entity = event.entity + if (entity is EntityArmorStand) { + for (stack in entity.inventory) { + if (stack == null) continue + val name = stack.name ?: continue + if (name == "§aFairy Souls") continue + if (name == "Glowstone") { + event.isCanceled = true + } + } + } } - private fun isEnabled() = LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.hideParticles + private fun isEnabled() = LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.hideParticles && hideParticles }
\ No newline at end of file |