Trace Refactor #233
@ -26,15 +26,14 @@ import de.steamwar.bausystem.features.simulator.gui.TNTSimulatorGui;
|
||||
import de.steamwar.bausystem.features.simulator.tnt.SimulatorElement;
|
||||
import de.steamwar.bausystem.features.simulator.tnt.TNTElement;
|
||||
import de.steamwar.bausystem.features.simulator.tnt.TNTGroup;
|
||||
import de.steamwar.bausystem.features.tracer.record.Recorder;
|
||||
import de.steamwar.bausystem.features.tracer.record.SingleTraceRecorder;
|
||||
import de.steamwar.bausystem.features.tracer.Recorder;
|
||||
import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.bausystem.shared.Pair;
|
||||
import de.steamwar.bausystem.utils.RayTraceUtils;
|
||||
import de.steamwar.entity.REntity;
|
||||
import de.steamwar.entity.REntityServer;
|
||||
import de.steamwar.linkage.LinkedInstance;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import yapion.hierarchy.types.YAPIONArray;
|
||||
@ -56,6 +55,11 @@ public class TNTSimulator {
|
||||
|
||||
private List<SimulatorElement> tntElementList = new ArrayList<>();
|
||||
|
||||
@LinkedInstance
|
||||
public Recorder traceRecorder;
|
||||
|
||||
private Region autoTraceRegion;
|
||||
|
||||
public TNTSimulator() {
|
||||
|
||||
}
|
||||
@ -225,7 +229,8 @@ public class TNTSimulator {
|
||||
}
|
||||
});
|
||||
if (needsAutoTrace.get()) {
|
||||
Recorder.INSTANCE.set(region, new SingleTraceRecorder());
|
||||
traceRecorder.startRecording(region);
|
||||
autoTraceRegion = region;
|
||||
}
|
||||
|
||||
AtomicInteger maxTick = new AtomicInteger(0);
|
||||
@ -247,7 +252,11 @@ public class TNTSimulator {
|
||||
AtomicInteger currentTick = new AtomicInteger(0);
|
||||
BauSystem.runTaskTimer(BauSystem.getInstance(), bukkitTask -> {
|
||||
int tick = currentTick.get();
|
||||
if (tick > maxTick.get()) bukkitTask.cancel();
|
||||
if (tick > maxTick.get()) {
|
||||
traceRecorder.stopRecording(autoTraceRegion);
|
||||
autoTraceRegion = null;
|
||||
bukkitTask.cancel();
|
||||
}
|
||||
currentTick.incrementAndGet();
|
||||
|
||||
List<List<Pair<Runnable, Integer>>> toSpawnInTick = toSpawn.get(tick);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren