diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-10-01 17:00:01 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-10-01 17:00:01 +0200 |
commit | ce00374e43f54ab574a8198f94d7a13270d48888 (patch) | |
tree | a6fa18deea59bb66cec166c2a5f412c0ca29beb2 /src/main/java/at/hannibal2/skyhanni/features/HideBlazeParticles.kt | |
parent | 9946e80fa0fb5da41c4ad8e5ace2edad6c519167 (diff) | |
download | skyhanni-ce00374e43f54ab574a8198f94d7a13270d48888.tar.gz skyhanni-ce00374e43f54ab574a8198f94d7a13270d48888.tar.bz2 skyhanni-ce00374e43f54ab574a8198f94d7a13270d48888.zip |
add blaze particle hide feature
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/HideBlazeParticles.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/HideBlazeParticles.kt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/HideBlazeParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/HideBlazeParticles.kt new file mode 100644 index 000000000..1216afe6a --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/HideBlazeParticles.kt @@ -0,0 +1,28 @@ +package at.hannibal2.skyhanni.features + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.SpawnParticleEvent +import at.hannibal2.skyhanni.utils.EntityUtils.getEntitiesNearby +import at.hannibal2.skyhanni.utils.LorenzVec +import net.minecraft.client.Minecraft +import net.minecraft.entity.monster.EntityBlaze +import net.minecraft.util.EnumParticleTypes +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class HideBlazeParticles { + + @SubscribeEvent + fun onSpawnParticle(event: SpawnParticleEvent) { + val particleId = event.particleId + if (!SkyHanniMod.feature.misc.hideBlazeParticles) return + + val particleType = EnumParticleTypes.values().find { it.particleID == particleId } + if (particleType != EnumParticleTypes.SMOKE_LARGE) return + + val location = LorenzVec(event.x, event.y, event.z) + val clazz = EntityBlaze::class.java + if (Minecraft.getMinecraft().theWorld.getEntitiesNearby(clazz, location, 3.0).isNotEmpty()) { + event.isCanceled = true + } + } +}
\ No newline at end of file |