Moved trace system init to plugin enable
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
D4rkr34lm 2024-08-18 11:53:14 +02:00
Ursprung 44faab9950
Commit fbb6d84dae
4 geänderte Dateien mit 32 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -28,6 +28,8 @@ import de.steamwar.bausystem.features.script.lua.libs.LuaLib;
import de.steamwar.bausystem.features.slaves.panzern.Panzern;
import de.steamwar.bausystem.features.slaves.panzern.PanzernAlgorithm;
import de.steamwar.bausystem.features.tpslimit.TPSFreezeUtils;
import de.steamwar.bausystem.features.tracer.TraceManager;
import de.steamwar.bausystem.features.tracer.TraceRecorder;
import de.steamwar.bausystem.features.world.BauScoreboard;
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
import de.steamwar.bausystem.region.loader.PrototypeLoader;
@ -197,6 +199,9 @@ public class BauSystem extends JavaPlugin implements Listener {
});
TickListener.impl.init();
TraceManager.instance.init();
TraceRecorder.instance.init();
}
@Override

Datei anzeigen

@ -41,7 +41,6 @@ import java.util.Optional;
* Recording of a tnt at a specific tick
*/
@Getter
@AllArgsConstructor
public class TNTPoint implements Externalizable {
/**
* Unique number to identify records being of the same tnt
@ -99,7 +98,31 @@ public class TNTPoint implements Externalizable {
private List<TNTPoint> history;
/**
* Constructor for creating a new trace point in trace recording
* Constructor for deserialization only !! Do not Call !!
*/
protected TNTPoint(int tntId, boolean explosion,
boolean inWater,
boolean afterFirstExplosion,
boolean destroyedBuildArea,
boolean destroyedTestBlock,
long ticksSinceStart,
int fuse,
Location location,
Vector velocity) {
this.tntId = tntId;
this.explosion = explosion;
this.inWater = inWater;
this.afterFirstExplosion = afterFirstExplosion;
this.destroyedBuildArea = destroyedBuildArea;
this.destroyedTestBlock = destroyedTestBlock;
this.ticksSinceStart = ticksSinceStart;
this.fuse = fuse;
this.location = location;
this.velocity = velocity;
}
/**
*
*/
public TNTPoint(int tntId, TNTPrimed tnt, boolean explosion, boolean afterFirstExplosion, long ticksSinceStart,
List<TNTPoint> history, List<Block> destroyedBlocks) {

Datei anzeigen

@ -49,9 +49,7 @@ public class TraceManager implements Listener {
@EventHandler
public void init(PluginEnableEvent event) {
if(!event.getPlugin().getName().equalsIgnoreCase("BauSystem")) {return;}
public void init() {
if (!tracesFolder.exists())
tracesFolder.mkdir();

Datei anzeigen

@ -71,9 +71,7 @@ public class TraceRecorder implements Listener {
*/
private final Set<Region> autoTraceRegions = new HashSet<>();
@EventHandler
public void init(PluginEnableEvent event) {
if(!event.getPlugin().getName().equalsIgnoreCase("BauSystem")) {return;}
public void init() {
BauSystem.runTaskTimer(BauSystem.getInstance(), () -> {
record();
checkForAutoTraceFinish();