diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-23 10:43:04 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-23 10:43:04 +0200 |
commit | 32ed904363a0c06dddfbbc21d0a85155f3d01625 (patch) | |
tree | c1763ae0e4cddb58beba212c4ed545aae7b82444 /src/main/java/at/hannibal2 | |
parent | 8f65037ffa653c73bd5d2cdeb83bd39889e06822 (diff) | |
download | skyhanni-32ed904363a0c06dddfbbc21d0a85155f3d01625.tar.gz skyhanni-32ed904363a0c06dddfbbc21d0a85155f3d01625.tar.bz2 skyhanni-32ed904363a0c06dddfbbc21d0a85155f3d01625.zip |
Added option to hide the vanilla particles around enderman
Diffstat (limited to 'src/main/java/at/hannibal2')
5 files changed, 32 insertions, 6 deletions
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 @@ -167,6 +167,12 @@ public class MiscConfig { 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 @ConfigAccordionId(id = 9) 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); } } } |