Hello!
I need to call every once in a while a certain function with all values in a list, and when defining this list I use some loops
Here's my code for it below for example ```java
for (int i = 0; i < particleCount; i++) {
final float ratio = (float) i / (particleCount - 1);
final double x = interpolate(aX, bX, ratio);
final double y = startY + 0.25;
final double z = interpolate(aZ, bZ, ratio);
particles.add(new Particles(Particle.DUST, x, y, z, 1, 0, 0, 0, 0, new Particle.DustOptions(Color.RED, 1))); // did the same with Runnables before, but it did the same issue
}My issue with it, is that when calling all particles, they all have the same values `x`, `y` and `z`, from the last particle added, as you can see in the logs below:
[20:05:06 INFO]: X:4.5 , Y:4.5 , Z:100.25
[20:05:06 INFO]: X:4.5 , Y:4.5 , Z:100.25
[20:05:06 INFO]: X:4.5 , Y:4.5 , Z:100.25
[20:05:06 INFO]: X:4.5 , Y:4.5 , Z:100.25
[20:05:06 INFO]: X:4.5 , Y:4.5 , Z:100.25
[20:05:06 INFO]: X:4.5 , Y:4.5 , Z:100.25
... some more lines saying the same thing
Thanks in advance!