forked from SteamWar/SteamWar
Moved trace system init to plugin enable
This commit is contained in:
@@ -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.Panzern;
|
||||||
import de.steamwar.bausystem.features.slaves.panzern.PanzernAlgorithm;
|
import de.steamwar.bausystem.features.slaves.panzern.PanzernAlgorithm;
|
||||||
import de.steamwar.bausystem.features.tpslimit.TPSFreezeUtils;
|
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.features.world.BauScoreboard;
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
import de.steamwar.bausystem.region.loader.PrototypeLoader;
|
import de.steamwar.bausystem.region.loader.PrototypeLoader;
|
||||||
@@ -197,6 +199,9 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
});
|
});
|
||||||
|
|
||||||
TickListener.impl.init();
|
TickListener.impl.init();
|
||||||
|
|
||||||
|
TraceManager.instance.init();
|
||||||
|
TraceRecorder.instance.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ import java.util.Optional;
|
|||||||
* Recording of a tnt at a specific tick
|
* Recording of a tnt at a specific tick
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
|
||||||
public class TNTPoint implements Externalizable {
|
public class TNTPoint implements Externalizable {
|
||||||
/**
|
/**
|
||||||
* Unique number to identify records being of the same tnt
|
* Unique number to identify records being of the same tnt
|
||||||
@@ -99,7 +98,31 @@ public class TNTPoint implements Externalizable {
|
|||||||
private List<TNTPoint> history;
|
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,
|
public TNTPoint(int tntId, TNTPrimed tnt, boolean explosion, boolean afterFirstExplosion, long ticksSinceStart,
|
||||||
List<TNTPoint> history, List<Block> destroyedBlocks) {
|
List<TNTPoint> history, List<Block> destroyedBlocks) {
|
||||||
|
|||||||
+1
-3
@@ -49,9 +49,7 @@ public class TraceManager implements Listener {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
public void init() {
|
||||||
public void init(PluginEnableEvent event) {
|
|
||||||
if(!event.getPlugin().getName().equalsIgnoreCase("BauSystem")) {return;}
|
|
||||||
if (!tracesFolder.exists())
|
if (!tracesFolder.exists())
|
||||||
tracesFolder.mkdir();
|
tracesFolder.mkdir();
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -71,9 +71,7 @@ public class TraceRecorder implements Listener {
|
|||||||
*/
|
*/
|
||||||
private final Set<Region> autoTraceRegions = new HashSet<>();
|
private final Set<Region> autoTraceRegions = new HashSet<>();
|
||||||
|
|
||||||
@EventHandler
|
public void init() {
|
||||||
public void init(PluginEnableEvent event) {
|
|
||||||
if(!event.getPlugin().getName().equalsIgnoreCase("BauSystem")) {return;}
|
|
||||||
BauSystem.runTaskTimer(BauSystem.getInstance(), () -> {
|
BauSystem.runTaskTimer(BauSystem.getInstance(), () -> {
|
||||||
record();
|
record();
|
||||||
checkForAutoTraceFinish();
|
checkForAutoTraceFinish();
|
||||||
|
|||||||
Reference in New Issue
Block a user