From a116f7e4b15da0da6882970eef99c10a6769a491 Mon Sep 17 00:00:00 2001 From: D4rkr34lm Date: Mon, 29 Apr 2024 20:16:27 +0200 Subject: [PATCH] Fixed fuse 80 subtick calc order problem with failsafe --- .../de/steamwar/bausystem/features/tracer/TraceRecorder.java | 4 +++- BauSystem_Main/src/plugin.yml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java index 124bdce5..952262ed 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java @@ -113,9 +113,9 @@ public class TraceRecorder implements Listener { public void stopRecording(Region region) { TraceRecordingWrapper wrappedTrace = activeTraces.getOrDefault(region, null); if (wrappedTrace == null) return; + System.out.println(wrappedTrace); wrappedTrace.finalizeRecording(); - activeTraces.remove(region); for (TNTPrimed tnt : trackedTNT.getOrDefault(region, Collections.emptyList())) { historyMap.remove(tnt); @@ -132,6 +132,7 @@ public class TraceRecorder implements Listener { Iterator iter = trackedTNT.getOrDefault(region, Collections.emptyList()).iterator(); while (iter.hasNext()) { TNTPrimed tnt = iter.next(); + if (tnt.getFuseTicks() == 80) continue; TNTPoint record = record(tnt, wrappedTrace, Collections.emptyList()); if (record == null) { iter.remove(); @@ -156,6 +157,7 @@ public class TraceRecorder implements Listener { */ private TNTPoint record(TNTPrimed tntPrimed, TraceRecordingWrapper wrappedTrace, List destroyedBlocks) { List history = historyMap.getOrDefault(tntPrimed, new ArrayList<>()); + // Failsave for tnt entering unloaded chunks if (tntPrimed.isDead() || history.size() > 0 && history.get(history.size() - 1).getFuse() == tntPrimed.getFuseTicks()) { return null; diff --git a/BauSystem_Main/src/plugin.yml b/BauSystem_Main/src/plugin.yml index a75ce068..71b08d95 100644 --- a/BauSystem_Main/src/plugin.yml +++ b/BauSystem_Main/src/plugin.yml @@ -1,7 +1,7 @@ name: BauSystem -authors: [Lixfel, YoyoNow, Chaoscaot, Zeanon] +authors: [ Lixfel, YoyoNow, Chaoscaot, Zeanon, D4rkr34lm ] version: "2.0" -depend: [WorldEdit, SpigotCore] +depend: [ WorldEdit, SpigotCore ] load: POSTWORLD main: de.steamwar.bausystem.BauSystem api-version: "1.13"