
Unsafe modulus
Closed this issue ยท 1 comments
Hi! In the DamageNumberParticle
int index = CritMode.extractIntegerPart(dz);
this.xd = POSITIONS.get((index % POSITIONS.size()));
will fail if index is negative. FloorMod should do the trick here, e.g.
this.xd = POSITIONS.get(Math.floorMod(index, POSITIONS.size()));
Specifically this issue can happen if another mod or maybe commands spawns that particle (In my case a particle previewer), passing unexpected velocities.