From 1cbe6141715d24c0fab6e412ff87bd0c9e96679b Mon Sep 17 00:00:00 2001 From: D4rkr34lm Date: Sun, 3 Mar 2024 22:18:31 +0100 Subject: [PATCH] Fixed nullpointer in auto trace finish check --- .../src/de/steamwar/bausystem/features/tracer/Recorder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/Recorder.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/Recorder.java index 0020b3fd..5fe0a99e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/Recorder.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/Recorder.java @@ -101,7 +101,7 @@ public class Recorder implements Listener { */ public void checkForAutoTraceFinish(){ for(Region region: autoTraceRegions) - if(autoTraceRegions.contains(region) && noTntRecordedCounter.get(region) > AUTO_TRACE_STOP_TRESHHOLD){ + if(autoTraceRegions.contains(region) && noTntRecordedCounter.get(region) != null && noTntRecordedCounter.get(region) > AUTO_TRACE_STOP_TRESHHOLD){ stopRecording(region); autoTraceRegions.remove(region); } @@ -160,7 +160,7 @@ public class Recorder implements Listener { List history = historyMap.getOrDefault(tntPrimed, new ArrayList<>()); UUID tntID; - if(historyMap.size() == 0){ + if(history.size() == 0){ historyMap.put(tntPrimed, history); tntID = UUID.randomUUID(); } @@ -169,7 +169,7 @@ public class Recorder implements Listener { TNTRecord record = new TNTRecord(tntID, tntPrimed, tntPrimed.getFuseTicks() == 0, TPSUtils.currentTick.get() - trace.getStartTime(), history); - history.add(record); + history.add(record); trace.add(record); }