Moved trace system init to plugin enable

This commit is contained in:
D4rkr34lm
2024-08-18 11:53:14 +02:00
parent 44faab9950
commit fbb6d84dae
4 changed files with 32 additions and 8 deletions
@@ -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) {
@@ -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();
@@ -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();