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