Add more particles to freedom leap

This commit is contained in:
Sam 2018-07-23 15:06:00 +01:00 committed by Alexander Meech
parent 9a2ebdfb33
commit 2d36508d69

View File

@ -32,7 +32,7 @@ public class DoubleJumpFreedom extends DoubleJumpEffectGadget
DustSpellColor red = new DustSpellColor(Color.RED), blue = new DustSpellColor(Color.BLUE), white = new DustSpellColor(Color.WHITE); DustSpellColor red = new DustSpellColor(Color.RED), blue = new DustSpellColor(Color.BLUE), white = new DustSpellColor(Color.WHITE);
Location location = player.getLocation().add(0, 1, 0); Location location = player.getLocation().add(0, 1, 0);
for (int i = 0; i < 5; i++) for (int i = 0; i < 10; i++)
{ {
playParticleAt(location, red); playParticleAt(location, red);
playParticleAt(location, blue); playParticleAt(location, blue);
@ -42,11 +42,16 @@ public class DoubleJumpFreedom extends DoubleJumpEffectGadget
private void playParticleAt(Location location, DustSpellColor colour) private void playParticleAt(Location location, DustSpellColor colour)
{ {
double x = Math.random() - 0.5, y = Math.random() - 0.5, z = Math.random() - 0.5; double x = random(2), y = random(1), z = random(2);
new ColoredParticle(ParticleType.RED_DUST, colour, location.add(x, y, z)) new ColoredParticle(ParticleType.RED_DUST, colour, location.add(x, y, z))
.display(); .display();
location.subtract(x, y, z); location.subtract(x, y, z);
} }
private double random(int x)
{
return (Math.random() - 0.5) * x;
}
} }