From 32ed904363a0c06dddfbbc21d0a85155f3d01625 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 23 Jul 2023 10:43:04 +0200 Subject: Added option to hide the vanilla particles around enderman --- .../skyhanni/config/features/MiscConfig.java | 6 ++++++ .../skyhanni/mixins/transformers/MixinBlockFire.java | 4 ++-- .../mixins/transformers/MixinEntityBlaze.java | 4 ++-- .../mixins/transformers/MixinEntityEnderman.java | 20 ++++++++++++++++++++ .../mixins/transformers/MixinEntityFireball.java | 4 ++-- 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityEnderman.java (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index 0292eb6cc..342d39aa2 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -166,6 +166,12 @@ public class MiscConfig { @ConfigAccordionId(id = 9) public boolean hideBlazeParticles = false; + @Expose + @ConfigOption(name = "Enderman Particles", desc = "Hide enderman particles.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 9) + public boolean hideEndermanParticles = false; + @Expose @ConfigOption(name = "Fireball Particles", desc = "Hide fireball particles.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinBlockFire.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinBlockFire.java index 3dfc0c22f..1bf74133d 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinBlockFire.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinBlockFire.java @@ -12,9 +12,9 @@ import org.spongepowered.asm.mixin.injection.Redirect; public class MixinBlockFire { @Redirect(method = "randomDisplayTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;spawnParticle(Lnet/minecraft/util/EnumParticleTypes;DDDDDD[I)V")) - private void onLivingUpdate(World world, EnumParticleTypes particleType, double x, double y, double z, double xOffset, double yOffset, double zOffset, int[] p_175688_14_) { + private void onLivingUpdate(World world, EnumParticleTypes particleType, double x, double y, double z, double xOffset, double yOffset, double zOffset, int[] parameters) { if (!SkyHanniMod.getFeature().misc.hideFireBlockParticles) { - world.spawnParticle(particleType, x, y, z, xOffset, yOffset, zOffset, p_175688_14_); + world.spawnParticle(particleType, x, y, z, xOffset, yOffset, zOffset, parameters); } } } diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityBlaze.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityBlaze.java index 7c21efa9f..7682abf21 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityBlaze.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityBlaze.java @@ -12,9 +12,9 @@ import org.spongepowered.asm.mixin.injection.Redirect; public class MixinEntityBlaze { @Redirect(method = "onLivingUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;spawnParticle(Lnet/minecraft/util/EnumParticleTypes;DDDDDD[I)V")) - private void onLivingUpdate(World world, EnumParticleTypes particleType, double x, double y, double z, double xOffset, double yOffset, double zOffset, int[] p_175688_14_) { + private void onLivingUpdate(World world, EnumParticleTypes particleType, double x, double y, double z, double xOffset, double yOffset, double zOffset, int[] parameters) { if (!SkyHanniMod.getFeature().misc.hideBlazeParticles) { - world.spawnParticle(particleType, x, y, z, xOffset, yOffset, zOffset, p_175688_14_); + world.spawnParticle(particleType, x, y, z, xOffset, yOffset, zOffset, parameters); } } } diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityEnderman.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityEnderman.java new file mode 100644 index 000000000..42402d16e --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityEnderman.java @@ -0,0 +1,20 @@ +package at.hannibal2.skyhanni.mixins.transformers; + +import at.hannibal2.skyhanni.SkyHanniMod; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(EntityEnderman.class) +public class MixinEntityEnderman { + + @Redirect(method = "onLivingUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;spawnParticle(Lnet/minecraft/util/EnumParticleTypes;DDDDDD[I)V")) + private void onLivingUpdate(World world, EnumParticleTypes particleType, double x, double y, double z, double xOffset, double yOffset, double zOffset, int[] parameters) { + if (!SkyHanniMod.getFeature().misc.hideEndermanParticles) { + world.spawnParticle(particleType, x, y, z, xOffset, yOffset, zOffset, parameters); + } + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityFireball.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityFireball.java index bf4f48171..573bbdb04 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityFireball.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityFireball.java @@ -12,9 +12,9 @@ import org.spongepowered.asm.mixin.injection.Redirect; public class MixinEntityFireball { @Redirect(method = "onUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;spawnParticle(Lnet/minecraft/util/EnumParticleTypes;DDDDDD[I)V")) - private void onLivingUpdate(World world, EnumParticleTypes particleType, double x, double y, double z, double xOffset, double yOffset, double zOffset, int[] p_175688_14_) { + private void onLivingUpdate(World world, EnumParticleTypes particleType, double x, double y, double z, double xOffset, double yOffset, double zOffset, int[] parameters) { if (!SkyHanniMod.getFeature().misc.hideFireballParticles) { - world.spawnParticle(particleType, x, y, z, xOffset, yOffset, zOffset, p_175688_14_); + world.spawnParticle(particleType, x, y, z, xOffset, yOffset, zOffset, parameters); } } } -- cgit