SteamWar/BauSystem2.0
Archiviert
12
0

Fix SimulatorExecutor
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed

Dieser Commit ist enthalten in:
yoyosource 2024-04-07 17:19:13 +02:00
Ursprung 7cd61fd9a4
Commit a6867cb4f9
2 geänderte Dateien mit 8 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -28,7 +28,6 @@ import de.steamwar.bausystem.region.Region;
import de.steamwar.bausystem.utils.TickEndEvent; import de.steamwar.bausystem.utils.TickEndEvent;
import de.steamwar.bausystem.utils.TickStartEvent; import de.steamwar.bausystem.utils.TickStartEvent;
import de.steamwar.linkage.Linked; import de.steamwar.linkage.Linked;
import de.steamwar.linkage.LinkedInstance;
import de.steamwar.linkage.MinVersion; import de.steamwar.linkage.MinVersion;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
@ -46,8 +45,6 @@ public class SimulatorExecutor implements Listener {
private static Set<Simulator> currentlyRunning = new HashSet<>(); private static Set<Simulator> currentlyRunning = new HashSet<>();
private static Map<Long, Map<Integer, List<SimulatorAction>>> tickStartActions = new HashMap<>(); private static Map<Long, Map<Integer, List<SimulatorAction>>> tickStartActions = new HashMap<>();
private static Map<Long, List<SimulatorAction>> tickEndActions = new HashMap<>(); private static Map<Long, List<SimulatorAction>> tickEndActions = new HashMap<>();
@LinkedInstance
private static TraceRecorder recorder;
public static boolean run(Simulator simulator) { public static boolean run(Simulator simulator) {
if (currentlyRunning.contains(simulator)) return false; if (currentlyRunning.contains(simulator)) return false;
@ -82,7 +79,7 @@ public class SimulatorExecutor implements Listener {
.map(Region::getRegion) .map(Region::getRegion)
.distinct() .distinct()
.forEach(region -> { .forEach(region -> {
recorder.stopRecording(region); TraceRecorder.instance.stopRecording(region);
}); });
} }
} }
@ -98,7 +95,7 @@ public class SimulatorExecutor implements Listener {
.map(Region::getRegion) .map(Region::getRegion)
.distinct() .distinct()
.forEach(region -> { .forEach(region -> {
recorder.startRecording(region); TraceRecorder.instance.startRecording(region);
}); });
} }
return true; return true;

Datei anzeigen

@ -37,6 +37,12 @@ import java.util.*;
@Linked @Linked
public class TraceRecorder implements Listener { public class TraceRecorder implements Listener {
public static TraceRecorder instance;
{
instance = this;
}
/** /**
* Linked instance of TraceManager * Linked instance of TraceManager
*/ */