From 1f4f1e95327e4a9e25cc29e687f3e2eee8b6351a Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 26 Jun 2021 14:08:10 +0200 Subject: [PATCH] Fix ParticleShowMode Signed-off-by: yoyosource --- .../features/tracer/show/mode/ParticleShowMode.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/mode/ParticleShowMode.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/mode/ParticleShowMode.java index 29eb6cc9..179d8bec 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/mode/ParticleShowMode.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/mode/ParticleShowMode.java @@ -29,6 +29,7 @@ import org.bukkit.Location; import org.bukkit.Particle; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitTask; +import org.bukkit.util.Vector; import java.util.HashSet; import java.util.Set; @@ -38,7 +39,7 @@ public class ParticleShowMode implements ShowMode { protected final Player player; protected final ShowModeParameter showModeParameter; - private Set positionSet = new HashSet<>(); + private Set positionSet = new HashSet<>(); private BukkitTask bukkitTask; @@ -49,15 +50,13 @@ public class ParticleShowMode implements ShowMode { @Override public void show(TNTPosition position) { - Location location = position.getLocation().toLocation(player.getWorld()); - Point point = Point.fromLocation(location); - if (positionSet.contains(point)) { + if (positionSet.contains(position.getLocation())) { return; } - positionSet.add(point); + positionSet.add(position.getLocation()); if (bukkitTask == null) { bukkitTask = Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> { - positionSet.forEach(p -> player.spawnParticle(Particle.BARRIER, p.toLocation(player), 1, 0, 0, 0, 0)); + positionSet.forEach(p -> player.spawnParticle(Particle.BARRIER, p.toLocation(player.getWorld()), 1, 0, 0, 0, 0)); }, 15L, 15L); } }