From 9fbbcdb3f76ca47657fac0e56bb104aca17380ef Mon Sep 17 00:00:00 2001 From: Octavia Togami Date: Sat, 17 Oct 2020 13:26:48 -0700 Subject: [PATCH] Make /toggleeditwand translatable 56182ad0793b79fe53927c1363be92a42e3af14d Co-Authored-By: Octavia Togami <2093023+octylFractal@users.noreply.github.com> --- .../worldedit/command/SelectionCommands.java | 20 ++++++++++--------- .../src/main/resources/lang/strings.json | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index dec829d8b..5e687b216 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -312,15 +312,17 @@ public class SelectionCommands { ) @CommandPermissions("worldedit.wand.toggle") public void toggleWand(Player player) { - player.printInfo(TextComponent.of("The selection wand is now a normal tool. You can disable it with ") - .append(TextComponent.of("/none", TextColor.AQUA).clickEvent( - ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "/none"))) - .append(TextComponent.of(" and rebind it to any item with ")) - .append(TextComponent.of("//selwand", TextColor.AQUA).clickEvent( - ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "//selwand"))) - .append(TextComponent.of(" or get a new wand with ")) - .append(TextComponent.of("//wand", TextColor.AQUA).clickEvent( - ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "//wand")))); + player.printInfo( + TranslatableComponent.of( + "worldedit.wand.selwand.now.tool", + TextComponent.of("/tool none", TextColor.AQUA).clickEvent( + ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "/tool none")), + TextComponent.of("/tool selwand", TextColor.AQUA).clickEvent( + ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "/tool selwand")), + TextComponent.of("//wand", TextColor.AQUA).clickEvent( + ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "//wand")) + ) + ); } @Command( diff --git a/worldedit-core/src/main/resources/lang/strings.json b/worldedit-core/src/main/resources/lang/strings.json index 9a8bf4a62..a1411c701 100644 --- a/worldedit-core/src/main/resources/lang/strings.json +++ b/worldedit-core/src/main/resources/lang/strings.json @@ -285,6 +285,7 @@ "worldedit.chunk.selected": "Chunk selected: {0}, {1}", "worldedit.wand.invalid": "Wand item is mis-configured or disabled.", "worldedit.wand.selwand.info": "Left click: select pos #1; Right click: select pos #2", + "worldedit.wand.selwand.now.tool": "The selection wand is now a normal tool. You can disable it with {0} and rebind it to any item with {1} or get a new wand with {2}.", "worldedit.wand.navwand.info": "Left click: jump to location; Right click: pass through walls", "worldedit.contract.contracted": "Region contracted {0} blocks.", "worldedit.shift.shifted": "Region shifted.",