Only get random offset when offset isn't 0

This commit is contained in:
Teriuihi 2022-02-23 02:44:42 +01:00
parent 433688e813
commit 46f6e2d999

View File

@ -25,9 +25,9 @@ public class Frame {
AParticles.forEach(AParticle -> { AParticles.forEach(AParticle -> {
ThreadLocalRandom current = ThreadLocalRandom.current(); ThreadLocalRandom current = ThreadLocalRandom.current();
AParticle.particleBuilder() AParticle.particleBuilder()
.location(tmpLocation.set(location.getX() + AParticle.x() + current.nextDouble(-AParticle.offset_range(), AParticle.offset_range()), .location(tmpLocation.set(location.getX() + AParticle.x() + AParticle.offset_range() == 0 ? 0 : current.nextDouble(-AParticle.offset_range(), AParticle.offset_range()),
location.getY() + AParticle.y() + current.nextDouble(-AParticle.offset_range(), AParticle.offset_range()), location.getY() + AParticle.y() + AParticle.offset_range() == 0 ? 0 : current.nextDouble(-AParticle.offset_range(), AParticle.offset_range()),
location.getZ() + AParticle.z() + current.nextDouble(-AParticle.offset_range(), AParticle.offset_range()))) location.getZ() + AParticle.z() + AParticle.offset_range() == 0 ? 0 : current.nextDouble(-AParticle.offset_range(), AParticle.offset_range())))
.receivers(Bukkit.getOnlinePlayers().stream() .receivers(Bukkit.getOnlinePlayers().stream()
.filter(player -> { .filter(player -> {
PlayerSettings playerSettings = PlayerSettings.getPlayer(player.getUniqueId()); PlayerSettings playerSettings = PlayerSettings.getPlayer(player.getUniqueId());