From 5af9cfcaad3763eecfa5bc31c38de93efbeee689 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 18 Apr 2024 17:42:40 +0200 Subject: [PATCH] Fix Trace.bundleRecords --- BauSystem_Main/src/BauSystem.properties | 1 - .../bausystem/features/tracer/TraceCommand.java | 12 ++++++------ .../bausystem/features/tracer/TraceManager.java | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index e7512036..bc211929 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -481,7 +481,6 @@ TRACE_RECORD=§aon TRACE_HAS_TRACES=§ehas Traces TRACE_IDLE_SINGLE=§esingle TRACE_IDLE_AUTO_IGNITE=§eauto -TRACE_MESSAGE_AUTO_IDLE_IGNITE = §aAuto-Tracer ignite started TRACE_MESSAGE_START = §aTNT-Tracer started TRACE_MESSAGE_STOP = §cTNT-Tracer stopped TRACE_MESSAGE_DELETE = §cAll TNT-positions deleted diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java index 3255deca..52525e4e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -67,25 +67,25 @@ public class TraceCommand extends SWCommand { } @Register(value = "show", description = "TRACE_COMMAND_HELP_SHOW") - public void show(@Validator Player player, @OptionalValue("STRICT") BundleFilter bundleFilter, ViewFlag... flags) { + public void show(@Validator Player player, @OptionalValue("DEFAULT") BundleFilter bundleFilter, ViewFlag... flags) { showInternal(player, bundleFilter, flags); BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW", player); } @Register(value = {"show", "at"}, description = "TRACE_COMMAND_HELP_SHOW_AT_WITH") - public void showAt(@Validator Player player, @Min(intValue = 0) int time, @StaticValue("with") String with, @OptionalValue("STRICT") BundleFilter bundleFilter, ViewFlag... flags) { + public void showAt(@Validator Player player, @Min(intValue = 0) int time, @StaticValue("with") String with, @OptionalValue("DEFAULT") BundleFilter bundleFilter, ViewFlag... flags) { showInternal(player, time, time, bundleFilter, flags); BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW_AT", player, time); } @Register(value = {"show", "from"}, description = "TRACE_COMMAND_HELP_SHOW_FROM_WITH") - public void showFromTo(@Validator Player player, @Min(intValue = 0) int from, @StaticValue("with") String with, @OptionalValue("STRICT") BundleFilter bundleFilter, ViewFlag... flags) { + public void showFromTo(@Validator Player player, @Min(intValue = 0) int from, @StaticValue("with") String with, @OptionalValue("DEFAULT") BundleFilter bundleFilter, ViewFlag... flags) { showInternal(player, from, Integer.MAX_VALUE, bundleFilter, flags); BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW_FROM", player, from); } @Register(value = {"show", "from"}, description = "TRACE_COMMAND_HELP_SHOW_FROM_TO_WITH") - public void showFromTo(@Validator Player player, @Min(intValue = 0) int from, @StaticValue("to") String toString, int to, @StaticValue("with") String with, @OptionalValue("STRICT") BundleFilter bundleFilter, ViewFlag... flags) { + public void showFromTo(@Validator Player player, @Min(intValue = 0) int from, @StaticValue("to") String toString, int to, @StaticValue("with") String with, @OptionalValue("DEFAULT") BundleFilter bundleFilter, ViewFlag... flags) { if (to < from) { BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW_TO_SMALLER", player); return; @@ -133,10 +133,10 @@ public class TraceCommand extends SWCommand { @Register(value = "clear") public void clear(@Validator Player player) { TraceManager.instance.clear(Region.getRegion(player.getLocation())); - BauSystem.MESSAGE.send("TRACE_MESSAGE_CLEAR", player); + BauSystem.MESSAGE.send("TRACE_MESSAGE_DELETE", player); } - @Register(value = "delete", description = "TRACE_MESSAGE_DELETE") + @Register(value = "delete", description = "TRACE_COMMAND_HELP_DELETE") public void delete(@Validator Player player, Trace trace) { TraceManager.instance.remove(trace); BauSystem.MESSAGE.send("TRACE_MESSAGE_DELETE_SPECIFIC", player); 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 878a1eda..e01aa675 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java @@ -217,7 +217,7 @@ public class TraceManager implements Listener { Region region = Region.getRegion(player.getLocation()); PlayerTraceShowData previous = showDataPerRegionPerPlayer.getOrDefault(region, Collections.emptyMap()).remove(player); if (previous == null) return; - tracesByRegion.getOrDefault(player, Collections.emptyMap()).forEach((integer, trace) -> { + tracesByRegion.getOrDefault(region, Collections.emptyMap()).forEach((integer, trace) -> { trace.hide(player); followerMap.getOrDefault(player, Collections.emptySet()).forEach(trace::hide); });