diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index b37e8e8b..9afe6154 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -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 diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPoint.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPoint.java index 1a34a684..182102d4 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPoint.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPoint.java @@ -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 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 history, List destroyedBlocks) { diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java index 2f9d6dfc..1f0c5140 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java @@ -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(); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java index 17218902..6a0a2314 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java @@ -71,9 +71,7 @@ public class TraceRecorder implements Listener { */ private final Set 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();