Make the empowerer particles respond to the particle option

Closes #364
This commit is contained in:
Ellpeck 2016-11-16 22:15:58 +01:00
parent b2372d4231
commit cb99c7859e

View file

@ -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);
}
}
}
}