From 295eb82fe918790d90b5355165522ed7a6fe0157 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 21 Apr 2024 14:29:26 +0200 Subject: [PATCH 1/3] Add TraceCommand.share --- BauSystem_Main/src/BauSystem.properties | 6 +++++- BauSystem_Main/src/BauSystem_de.properties | 4 ++++ .../steamwar/bausystem/features/tracer/TraceCommand.java | 9 +++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 6b52862b..6fc4c270 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -490,6 +490,7 @@ TRACE_MESSAGE_SHOW_AT=§aTNT-positions shown at {0} TRACE_MESSAGE_SHOW_FROM=§aAll TNT-positions shown from {0} TRACE_MESSAGE_SHOW_FROM_TO=§aAll TNT-positions shown from {0} to {1} TRACE_MESSAGE_SHOW_TO_SMALLER = §cTo must be bigger then from +TRACE_MESSAGE_SHARE=§e{0} shared his trace show state. Click to view. TRACE_COMMAND_HELP_START = §8/§etrace start §8- §7Starts recording of all TNT-positions TRACE_COMMAND_HELP_STOP = §8/§etrace stop §8- §7Stops the TNT-Tracer @@ -503,7 +504,10 @@ TRACE_COMMAND_HELP_SHOW_FROM_TO=§8/§etrace show §7from §8<§eFROM§8> §7to TRACE_COMMAND_HELP_SHOW_FROM_TO_WITH=§8/§etrace show §7from §8<§eFROM§8> §7to §8<§eTO§8> §7with §8<§eParameter§8> - §7Shows all Trace Positions from §8<§eFROM§8> to §8<§eTO§8> TRACE_COMMAND_HELP_HIDE = §8/§etrace hide §8- §7Hides all TNT-positions TRACE_COMMAND_HELP_DELETE=§8/§etrace delete §8[§eTrace§8] §8- §7Deletes all TNT-positions or a Trace -TRACE_COMMAND_HELP_ISOLATE=§8/§etrace isolate §8[§eTrace§8] §8[§eTNT§8] §8- §7Isolates specific TNTs from the Trace +TRACE_COMMAND_HELP_ISOLATE=§8/§etrace isolate §8[§eTrace§8] §8[§eTNT§8] §8- §7Isolates specific TNTs from the Trace +TRACE_COMMAND_HELP_SHARE=§8/§etrace share §8- §7Share your current Trace show state with others +TRACE_COMMAND_HELP_FOLLOW=§8/§etrace follow §8[§ePlayer§8] §8- §7Follow a players Trace show state +TRACE_COMMAND_HELP_UNFOLLOW=§8/§etrace unfollow §8- §7Unfollow the Trace show state TRACE_GUI_ITEM_NAME = §eTracer TRACE_GUI_ITEM_LORE = §7Status§8: {0} diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index 0c33a977..b89cc5f4 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -467,6 +467,7 @@ TRACE_MESSAGE_SHOW_AT=§aTNT-positions angezeigt bei {0} TRACE_MESSAGE_SHOW_FROM=§aAll TNT-positions angezeigt von {0} TRACE_MESSAGE_SHOW_FROM_TO=§aAll TNT-positions angezeigt von {0} bis {1} TRACE_MESSAGE_SHOW_TO_SMALLER = §cBis muss größer als von sein +TRACE_MESSAGE_SHARE=§e{0} teilte seinen Trace-Show-Status. Zum Ansehen klicken. TRACE_COMMAND_HELP_START = §8/§etrace start §8- §7Startet die Aufnahme aller TNT-Positionen TRACE_COMMAND_HELP_SINGLE = §8/§etrace single §8- §7Startet eine einzelne Aufnahme aller TNT-Positionen @@ -479,6 +480,9 @@ TRACE_COMMAND_HELP_SHOW_FROM = §8/§etrace show §8(§etime§8|§7fuse§8) §7f TRACE_COMMAND_HELP_SHOW_FROM_TO = §8/§etrace show §8(§etime§8|§7fuse§8) §7from §8<§eFROM§8> §7to §8<§eTO§8> - §7Zeigt alle TNT-Positionen zwischen §8<§eFROM§8> und §8<§eTO§8> TRACE_COMMAND_HELP_HIDE = §8/§etrace hide §8- §7Versteckt alle TNT-Positionen TRACE_COMMAND_HELP_DELETE = §8/§etrace delete §8- §7Löscht alle TNT-Positionen +TRACE_COMMAND_HELP_SHARE=§8/§etrace share §8- §7Teilt den aktuellen Trace-Show-Status mit anderen +TRACE_COMMAND_HELP_FOLLOW=§8/§etrace follow §8[§ePlayer§8] §8- §7Verfolgen eines Spielers Status anzeigen +TRACE_COMMAND_HELP_UNFOLLOW=§8/§etrace unfollow §8- §7Den Status der Trace-Anzeige aufheben TRACE_GUI_ITEM_NAME = §eTracer TRACE_GUI_ITEM_LORE = §7Status§8: {0} 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 afd10cc7..7aec03b2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -29,6 +29,7 @@ import de.steamwar.command.PreviousArguments; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeMapper; import de.steamwar.linkage.Linked; +import net.md_5.bungee.api.chat.ClickEvent; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -148,12 +149,12 @@ public class TraceCommand extends SWCommand { // TODO: Add Message! } - @Register(value = "share", description = "TRACE_COMMAND_HELP_SHOW") + @Register(value = "share", description = "TRACE_COMMAND_HELP_SHARE") public void share(@Validator Player player) { - // TODO Rücksprache + BauSystem.MESSAGE.broadcast("TRACE_MESSAGE_SHARE", null, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/trace follow " + player.getName()), player.getName()); } - @Register(value = "follow", description = "TRACE_COMMAND_HELP_SHOW") + @Register(value = "follow", description = "TRACE_COMMAND_HELP_FOLLOW") public void follow(@Validator Player player, Player toFollow) { if (player == toFollow) { // TODO: Implement message @@ -163,7 +164,7 @@ public class TraceCommand extends SWCommand { // TODO: Implement message } - @Register(value = "unfollow", description = "TRACE_COMMAND_HELP_SHOW") + @Register(value = "unfollow", description = "TRACE_COMMAND_HELP_UNFOLLOW") public void unfollow(@Validator Player player) { TraceManager.instance.unfollow(player); // TODO: Implement message From 56a72b1e83f00fec747b377a5edf114cb05a3699 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 21 Apr 2024 14:36:15 +0200 Subject: [PATCH 2/3] Add TraceCommand.share --- BauSystem_Main/src/BauSystem.properties | 3 ++- BauSystem_Main/src/BauSystem_de.properties | 3 ++- .../de/steamwar/bausystem/features/tracer/TraceCommand.java | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 6fc4c270..4b2c9792 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -490,7 +490,8 @@ TRACE_MESSAGE_SHOW_AT=§aTNT-positions shown at {0} TRACE_MESSAGE_SHOW_FROM=§aAll TNT-positions shown from {0} TRACE_MESSAGE_SHOW_FROM_TO=§aAll TNT-positions shown from {0} to {1} TRACE_MESSAGE_SHOW_TO_SMALLER = §cTo must be bigger then from -TRACE_MESSAGE_SHARE=§e{0} shared his trace show state. Click to view. +TRACE_MESSAGE_SHARE=§e{0} shared his trace show state. +TRACE_MESSAGE_SHARE_HOVER=§eClick to view TRACE_COMMAND_HELP_START = §8/§etrace start §8- §7Starts recording of all TNT-positions TRACE_COMMAND_HELP_STOP = §8/§etrace stop §8- §7Stops the TNT-Tracer diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index b89cc5f4..b3871b82 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -467,7 +467,8 @@ TRACE_MESSAGE_SHOW_AT=§aTNT-positions angezeigt bei {0} TRACE_MESSAGE_SHOW_FROM=§aAll TNT-positions angezeigt von {0} TRACE_MESSAGE_SHOW_FROM_TO=§aAll TNT-positions angezeigt von {0} bis {1} TRACE_MESSAGE_SHOW_TO_SMALLER = §cBis muss größer als von sein -TRACE_MESSAGE_SHARE=§e{0} teilte seinen Trace-Show-Status. Zum Ansehen klicken. +TRACE_MESSAGE_SHARE=§e{0} teilte seinen Trace-Show-Status. +TRACE_MESSAGE_SHARE_HOVER=§eZum Ansehen klicken. TRACE_COMMAND_HELP_START = §8/§etrace start §8- §7Startet die Aufnahme aller TNT-Positionen TRACE_COMMAND_HELP_SINGLE = §8/§etrace single §8- §7Startet eine einzelne Aufnahme aller TNT-Positionen 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 7aec03b2..81ecea7d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -151,7 +151,7 @@ public class TraceCommand extends SWCommand { @Register(value = "share", description = "TRACE_COMMAND_HELP_SHARE") public void share(@Validator Player player) { - BauSystem.MESSAGE.broadcast("TRACE_MESSAGE_SHARE", null, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/trace follow " + player.getName()), player.getName()); + BauSystem.MESSAGE.broadcast("TRACE_MESSAGE_SHARE", "TRACE_MESSAGE_SHARE_HOVER", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/trace follow " + player.getName()), player.getName()); } @Register(value = "follow", description = "TRACE_COMMAND_HELP_FOLLOW") From 09aa662171976abebe728bd53a4b2ec0ccf4ba0b Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 21 Apr 2024 14:46:47 +0200 Subject: [PATCH 3/3] Add messages to TraceCommand --- BauSystem_Main/src/BauSystem.properties | 5 +++++ BauSystem_Main/src/BauSystem_de.properties | 17 +++++------------ .../bausystem/features/tracer/TraceCommand.java | 13 ++++++++----- .../features/tracer/TraceRecorder.java | 9 +++++---- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 4b2c9792..e9ddfc9c 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -481,6 +481,8 @@ TRACE_RECORD=§aon TRACE_HAS_TRACES=§ehas Traces TRACE_IDLE_AUTO=§eauto TRACE_MESSAGE_START = §aTNT-Tracer started +TRACE_MESSAGE_AUTO_START=§eAuto TNT-Tracer started +TRACE_MESSAGE_AUTO_STOP=§cAuto TNT-Tracer stopped TRACE_MESSAGE_STOP = §cTNT-Tracer stopped TRACE_MESSAGE_CLEAR=§cAll TNT-positions deleted TRACE_MESSAGE_DELETE=§cTrace TNT-positions deleted @@ -492,6 +494,9 @@ TRACE_MESSAGE_SHOW_FROM_TO=§aAll TNT-positions shown from {0} to {1} TRACE_MESSAGE_SHOW_TO_SMALLER = §cTo must be bigger then from TRACE_MESSAGE_SHARE=§e{0} shared his trace show state. TRACE_MESSAGE_SHARE_HOVER=§eClick to view +TRACE_MESSAGE_FOLLOW=§aYou are now following {0} Trace show state +TRACE_MESSAGE_FOLLOW_SELF=§cYou cannot follow yourself! +TRACE_MESSAGE_UNFOLLOW=§eYou are no longer following a Trace show state TRACE_COMMAND_HELP_START = §8/§etrace start §8- §7Starts recording of all TNT-positions TRACE_COMMAND_HELP_STOP = §8/§etrace stop §8- §7Stops the TNT-Tracer diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index b3871b82..11cbacac 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -448,33 +448,26 @@ TPSLIMIT_FROZEN = §eTPS eingefroren. # Trace TRACE_RECORD=§aan TRACE_HAS_TRACES=§ehat Traces -TRACE_MESSAGE_AUTO_IDLE_IGNITE = §aAuto-Tracer ignite gestartet -TRACE_MESSAGE_AUTO_DELETE_INVALID = §cAuto delete kann aktuell nicht genutzt werden -TRACE_MESSAGE_AUTO_DELETE_ALWAYS = §7Der letzte Schuss wird §eimmer§7 gelöscht -TRACE_MESSAGE_AUTO_DELETE_NEVER = §7Der letzte Schuss wird §enie§7 gelöscht -TRACE_MESSAGE_AUTO_DELETE_NO_BUILD_DESTROY = §7Der letzte Schuss wird gelöscht, wenn §ekein§7 Block aus dem §eBaubereich§7 zerstört wurde -TRACE_MESSAGE_AUTO_DELETE_BUILD_DESTROY = §7Der letzte Schuss wird gelöscht, wenn §eein§7 Block aus dem §eBaubereich§7 zerstört wurde -TRACE_MESSAGE_AUTO_DELETE_NO_TESTBLOCK_DESTROY = §7Der letzte Schuss wird gelöscht, wenn §ekein§7 Block aus dem §eTestblock§7 zerstört wurde -TRACE_MESSAGE_AUTO_DELETE_TESTBLOCK_DESTROY = §7Der letzte Schuss wird gelöscht, wenn §eein§7 Block aus dem §eTestblock§7 zerstört wurde TRACE_MESSAGE_START = §aTNT-Tracer gestartet -TRACE_MESSAGE_SINGLE = §aSingle-Tracer gestartet +TRACE_MESSAGE_AUTO_START=§eAuto TNT-Tracer gestartet +TRACE_MESSAGE_AUTO_STOP=§cAuto TNT-Tracer gestoppt TRACE_MESSAGE_STOP = §cTNT-Tracer gestoppt TRACE_MESSAGE_CLEAR=§cAlle TNT-Positionen gelöscht TRACE_MESSAGE_SHOW = §aAlle TNT-Positionen angezeigt TRACE_MESSAGE_HIDE = §cAlle TNT-Positionen ausgeblendet -TRACE_MESSAGE_DISALLOWED = §cDu darfst hier nicht den TNT-Tracer nutzen TRACE_MESSAGE_SHOW_AT=§aTNT-positions angezeigt bei {0} TRACE_MESSAGE_SHOW_FROM=§aAll TNT-positions angezeigt von {0} TRACE_MESSAGE_SHOW_FROM_TO=§aAll TNT-positions angezeigt von {0} bis {1} TRACE_MESSAGE_SHOW_TO_SMALLER = §cBis muss größer als von sein TRACE_MESSAGE_SHARE=§e{0} teilte seinen Trace-Show-Status. TRACE_MESSAGE_SHARE_HOVER=§eZum Ansehen klicken. +TRACE_MESSAGE_FOLLOW=§aSie folgen nun {0} Trace show state +TRACE_MESSAGE_FOLLOW_SELF=§cSie können sich selbst nicht folgen! +TRACE_MESSAGE_UNFOLLOW=§eSie folgen nicht mehr dem Status einer Trace-Show TRACE_COMMAND_HELP_START = §8/§etrace start §8- §7Startet die Aufnahme aller TNT-Positionen -TRACE_COMMAND_HELP_SINGLE = §8/§etrace single §8- §7Startet eine einzelne Aufnahme aller TNT-Positionen TRACE_COMMAND_HELP_STOP = §8/§etrace stop §8- §7Stoppt den TNT-Tracer TRACE_COMMAND_HELP_AUTO = §8/§etrace toggleauto §8- §7Automatischer Aufnahmenstart -TRACE_COMMAND_HELP_AUTO_REMOVE = §8/§etrace autoremove §8<§eParameter§8> §8- §7Löscht den letzten Trace automatisch TRACE_COMMAND_HELP_SHOW = §8/§etrace show §8<§eParameter§8> - §7Zeigt alle TNT-Positionen TRACE_COMMAND_HELP_SHOW_AT = §8/§etrace show §8(§etime§8|§7fuse§8) §7at §8<§eTIME§8> - §7Zeigt alle TNT-Positionen bei §8<§eTIME§8> an TRACE_COMMAND_HELP_SHOW_FROM = §8/§etrace show §8(§etime§8|§7fuse§8) §7from §8<§eFROM§8> - §7Zeigt alle TNT-Positionen von §8<§eFROM§8> 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 81ecea7d..26ded08b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -63,8 +63,11 @@ public class TraceCommand extends SWCommand { @Register(value = "auto", description = "TRACE_COMMAND_HELP_AUTO") public void auto(@Validator Player player) { Region region = Region.getRegion(player.getLocation()); - TraceRecorder.instance.toggleAutoTrace(region); - // TODO: Add Auto toggle Message! + if (TraceRecorder.instance.toggleAutoTrace(region)) { + BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_START", player); + } else { + BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_STOP", player); + } } @Register(value = "show", description = "TRACE_COMMAND_HELP_SHOW") @@ -157,17 +160,17 @@ public class TraceCommand extends SWCommand { @Register(value = "follow", description = "TRACE_COMMAND_HELP_FOLLOW") public void follow(@Validator Player player, Player toFollow) { if (player == toFollow) { - // TODO: Implement message + BauSystem.MESSAGE.send("TRACE_MESSAGE_FOLLOW_SELF", player); return; } TraceManager.instance.follow(player, toFollow); - // TODO: Implement message + BauSystem.MESSAGE.send("TRACE_MESSAGE_FOLLOW", player, toFollow.getName()); } @Register(value = "unfollow", description = "TRACE_COMMAND_HELP_UNFOLLOW") public void unfollow(@Validator Player player) { TraceManager.instance.unfollow(player); - // TODO: Implement message + BauSystem.MESSAGE.send("TRACE_MESSAGE_UNFOLLOW", player); } @ClassMapper(value = Trace.class, local = true) 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 b7ac25a1..52b87156 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java @@ -79,11 +79,12 @@ public class TraceRecorder implements Listener { * * @param region */ - public void toggleAutoTrace(Region region) { - if (autoTraceRegions.contains(region)) { - autoTraceRegions.remove(region); - } else { + public boolean toggleAutoTrace(Region region) { + if (!autoTraceRegions.remove(region)) { autoTraceRegions.add(region); + return true; + } else { + return false; } }