diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java index 9e68f016..54f0af6c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java @@ -25,8 +25,6 @@ import de.steamwar.bausystem.configplayer.Config; import de.steamwar.bausystem.features.autostart.AutostartListener; import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage; import de.steamwar.bausystem.features.detonator.storage.ItemStorage; -import de.steamwar.bausystem.utils.NMSWrapper; -import de.steamwar.entity.REntity; import de.steamwar.entity.REntityServer; import de.steamwar.entity.RFallingBlockEntity; import lombok.experimental.UtilityClass; @@ -57,6 +55,11 @@ public class Detonator { public static void showDetonator(Player p, List locs) { if (ENTITIES_MAP.containsKey(p)) return; REntityServer entities = new REntityServer(); + entities.setCallback((player, rEntity, entityAction) -> { + Vector vector = new Vector(rEntity.getX(), rEntity.getY(), rEntity.getZ()); + DetonatorListener.addLocationToDetonator(vector.toLocation(player.getWorld()), player); + DetonatorListener.HAS_UPDATED.add(player); + }); entities.addPlayer(p); ENTITIES_MAP.put(p, entities); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java index f7577e14..be8e8ce9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java @@ -41,9 +41,9 @@ import java.util.Set; @Linked public class DetonatorListener implements Listener { - private static final Set HAS_UPDATED = new HashSet<>(); + static final Set HAS_UPDATED = new HashSet<>(); - private static void addLocationToDetonator(Location location, Player p) { + static void addLocationToDetonator(Location location, Player p) { Detoblock detoblock = Detonator.getBlock(location.getBlock()); if (detoblock == Detoblock.INVALID) { SWUtils.sendToActionbar(p, BauSystem.MESSAGE.parse("DETONATOR_INVALID_BLOCK", p));