From a6867cb4f969df56a68413fb245758a02f04b62a Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 7 Apr 2024 17:19:13 +0200 Subject: [PATCH] Fix SimulatorExecutor --- .../features/simulator/execute/SimulatorExecutor.java | 7 ++----- .../steamwar/bausystem/features/tracer/TraceRecorder.java | 6 ++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/execute/SimulatorExecutor.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/execute/SimulatorExecutor.java index 39c2e60b..5c3d30e0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/execute/SimulatorExecutor.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/execute/SimulatorExecutor.java @@ -28,7 +28,6 @@ import de.steamwar.bausystem.region.Region; import de.steamwar.bausystem.utils.TickEndEvent; import de.steamwar.bausystem.utils.TickStartEvent; import de.steamwar.linkage.Linked; -import de.steamwar.linkage.LinkedInstance; import de.steamwar.linkage.MinVersion; import org.bukkit.Bukkit; import org.bukkit.World; @@ -46,8 +45,6 @@ public class SimulatorExecutor implements Listener { private static Set currentlyRunning = new HashSet<>(); private static Map>> tickStartActions = new HashMap<>(); private static Map> tickEndActions = new HashMap<>(); - @LinkedInstance - private static TraceRecorder recorder; public static boolean run(Simulator simulator) { if (currentlyRunning.contains(simulator)) return false; @@ -82,7 +79,7 @@ public class SimulatorExecutor implements Listener { .map(Region::getRegion) .distinct() .forEach(region -> { - recorder.stopRecording(region); + TraceRecorder.instance.stopRecording(region); }); } } @@ -98,7 +95,7 @@ public class SimulatorExecutor implements Listener { .map(Region::getRegion) .distinct() .forEach(region -> { - recorder.startRecording(region); + TraceRecorder.instance.startRecording(region); }); } return true; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java index f79945b3..58f719bf 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java @@ -37,6 +37,12 @@ import java.util.*; @Linked public class TraceRecorder implements Listener { + public static TraceRecorder instance; + + { + instance = this; + } + /** * Linked instance of TraceManager */