diff options
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 |