Trace Refactor #233
@ -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;
|
||||||
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren