From a389e0666c811f5a3bf4f75e61b314e7cea2c109 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 11 Feb 2023 08:15:31 +0100 Subject: Added more particle hiders: far particles, near redstone particles, smoke particles. --- .../skyhanni/features/misc/ParticleHider.kt | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt new file mode 100644 index 000000000..1f4eda9a5 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt @@ -0,0 +1,38 @@ +package at.hannibal2.skyhanni.features.misc + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.ReceiveParticleEvent +import at.hannibal2.skyhanni.utils.LocationUtils +import net.minecraft.util.EnumParticleTypes +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class ParticleHider { + + @SubscribeEvent + fun onHypExplosions(event: ReceiveParticleEvent) { + val distance = event.location.distance(LocationUtils.playerLocation()) + if (SkyHanniMod.feature.misc.hideFarParticles) { + if (distance > 40) { + event.isCanceled = true + return + } + } + + val type = event.type + if (SkyHanniMod.feature.misc.hideCloseRedstoneparticles) { + if (type == EnumParticleTypes.REDSTONE) { + if (distance < 2) { + event.isCanceled = true + return + } + } + } + + if (SkyHanniMod.feature.misc.hideFireballParticles) { + if (type == EnumParticleTypes.SMOKE_NORMAL || type == EnumParticleTypes.SMOKE_LARGE) { + event.isCanceled = true + return + } + } + } +} \ No newline at end of file -- cgit