From 4620e83a8273b0a083ef5955474453289c802d3e Mon Sep 17 00:00:00 2001 From: D4rkr34lm Date: Sat, 2 Mar 2024 22:18:04 +0100 Subject: [PATCH] Reintroduced id return on trace recording start --- .../src/de/steamwar/bausystem/features/tracer/Recorder.java | 5 +++-- .../de/steamwar/bausystem/features/tracer/TraceManager.java | 4 +++- 2 files changed, 6 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 a94109ed..0020b3fd 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/Recorder.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/Recorder.java @@ -111,11 +111,12 @@ public class Recorder implements Listener { * * @param region region to be recorded */ - public void startRecording(Region region){ - if(activeTraces.containsKey(region)) return; + public int startRecording(Region region){ + if(activeTraces.containsKey(region)) return -1; if(autoTraceRegions.contains(region)) noTntRecordedCounter.put(region, 0); Trace trace = new Trace(region); activeTraces.put(region, trace); + return manager.add(trace); } /** Stops the recording at the given region diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java index 71f6a3ef..8308b7b5 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java @@ -56,12 +56,14 @@ public class TraceManager implements Listener { /** Adds a new trace to the global record * * @param trace Trace to be added + * @return id of the created trace */ - protected void add(Trace trace){ + protected int add(Trace trace){ for(Player player: viewFlagMap.keySet()) trace.render(player, viewFlagMap.get(player), bundleFilterMap.get(player)); traces.put(nextOpenId, trace); nextOpenId++; + return nextOpenId--; } /** Removes the trace with the given id