From 9d91c4e3ebcd8bada4382ac720a1c151be358032 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 31 Aug 2023 16:53:45 +0200 Subject: [PATCH] Add basic Simulator Preview Signed-off-by: yoyosource --- .../bausystem/features/simulator/TNTSimulatorListener.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java index 374d1192..41d6e1ed 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java @@ -116,6 +116,10 @@ public class TNTSimulatorListener implements Listener { if (simulator == null) return; Pair>>>> toCalculate = simulator.locations(event.getPlayer()); PreviewRecord previewRecord = Simulator.impl.run(toCalculate); + if (previewRecord == null) { + event.setCancelled(true); + return; + } previewRecord.add(event.getPlayer()); }