From cb99c7859e296b0bf685049f013145a64928cab4 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 16 Nov 2016 22:15:58 +0100 Subject: [PATCH] Make the empowerer particles respond to the particle option Closes #364 --- .../ellpeck/actuallyadditions/mod/util/AssetUtil.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java index 2dc681008..0998f10b5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java @@ -189,9 +189,10 @@ public final class AssetUtil{ @SideOnly(Side.CLIENT) public static void renderParticlesFromAToB(double startX, double startY, double startZ, double endX, double endY, double endZ, int particleAmount, float particleSize, float[] color, float ageMultiplier){ - World world = Minecraft.getMinecraft().theWorld; + Minecraft mc = Minecraft.getMinecraft(); + int particleSetting = mc.gameSettings.particleSetting; - if(Minecraft.getMinecraft().thePlayer.getDistance(startX, startY, startZ) <= 64 || Minecraft.getMinecraft().thePlayer.getDistance(endX, endY, endZ) <= 64){ + if(mc.thePlayer.getDistance(startX, startY, startZ) <= 64 || mc.thePlayer.getDistance(endX, endY, endZ) <= 64){ double difX = startX-endX; double difY = startY-endY; double difZ = startZ-endZ; @@ -199,8 +200,10 @@ public final class AssetUtil{ for(int times = 0; times < Math.max(particleAmount/2, 1); times++){ for(double i = 0; i <= 1; i += 1/(distance*particleAmount)){ - ParticleColored fx = new ParticleColored(world, (difX*i)+endX+0.5, (difY*i)+endY+0.5, (difZ*i)+endZ+0.5, particleSize, color[0], color[1], color[2], ageMultiplier); - Minecraft.getMinecraft().effectRenderer.addEffect(fx); + if(particleSetting == 0 || (particleSetting == 1 && mc.theWorld.rand.nextFloat() >= 0.8F) || (particleSetting > 1 && mc.theWorld.rand.nextFloat() >= 0.98F)){ + ParticleColored fx = new ParticleColored(mc.theWorld, (difX*i)+endX+0.5, (difY*i)+endY+0.5, (difZ*i)+endZ+0.5, particleSize, color[0], color[1], color[2], ageMultiplier); + mc.effectRenderer.addEffect(fx); + } } } }