Fixed magic particles not using the correct colours

This commit is contained in:
Sollace 2021-12-26 16:09:59 +02:00
parent df2706cfc6
commit 9460957c56

View file

@ -1,5 +1,7 @@
package com.minelittlepony.unicopia.client.particle; package com.minelittlepony.unicopia.client.particle;
import com.minelittlepony.unicopia.particle.MagicParticleEffect;
import net.minecraft.client.particle.ParticleTextureSheet; import net.minecraft.client.particle.ParticleTextureSheet;
import net.minecraft.client.particle.SpriteBillboardParticle; import net.minecraft.client.particle.SpriteBillboardParticle;
import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.particle.SpriteProvider;
@ -35,20 +37,29 @@ public class MagicParticle extends SpriteBillboardParticle {
colorAlpha = 0.7F; colorAlpha = 0.7F;
colorGreen *= 0.3F; colorGreen *= 0.3F;
if (random.nextBoolean()) { if (effect instanceof MagicParticleEffect) {
colorBlue *= 0.4F; MagicParticleEffect parameters = (MagicParticleEffect)effect;
}
if (random.nextBoolean()) {
colorRed *= 0.9F;
}
if (random.nextBoolean()) {
colorGreen += 0.5F;
}
if (random.nextBoolean()) { colorRed = parameters.getColor().getX();
colorGreen *= 2F; colorGreen = parameters.getColor().getY();
} else if (random.nextBoolean()) { colorBlue = parameters.getColor().getZ();
colorRed *= 3.9F; } else {
if (random.nextBoolean()) {
colorBlue *= 0.4F;
}
if (random.nextBoolean()) {
colorRed *= 0.9F;
}
if (random.nextBoolean()) {
colorGreen += 0.5F;
}
if (random.nextBoolean()) {
colorGreen *= 2F;
} else if (random.nextBoolean()) {
colorRed *= 3.9F;
}
} }
} }