From 3610af15e8f8c1349ee11cae9fee76c024d2ead9 Mon Sep 17 00:00:00 2001 From: Orlaando <38089755+Orlaando-dev@users.noreply.github.com> Date: Tue, 19 Apr 2022 00:55:19 -0600 Subject: [PATCH] Show number of affected blocks in //set command (#1703) * Show # of blocks affected in //set * Fix typo * fix: Add amount of blocks affected to strings.json Co-authored-by: NotMyFault --- .../main/java/com/sk89q/worldedit/command/RegionCommands.java | 3 ++- worldedit-core/src/main/resources/lang/strings.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index fcdbdb490..8f8774468 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -116,7 +116,8 @@ public class RegionCommands { ) { int affected = editSession.setBlocks(region, pattern); if (affected != 0) { - actor.print(Caption.of("worldedit.set.done")); + actor.print(Caption.of("worldedit.set.done", TextComponent.of(affected))); + } return affected; } diff --git a/worldedit-core/src/main/resources/lang/strings.json b/worldedit-core/src/main/resources/lang/strings.json index 4859b8f4d..62db569de 100644 --- a/worldedit-core/src/main/resources/lang/strings.json +++ b/worldedit-core/src/main/resources/lang/strings.json @@ -444,7 +444,7 @@ "worldedit.rotate.rotated": "The clipboard copy has been rotated.", "worldedit.flip.flipped": "The clipboard copy has been flipped.", "worldedit.clearclipboard.cleared": "Clipboard cleared.", - "worldedit.set.done": "Operation completed.", + "worldedit.set.done": "Operation completed ({0}).", "worldedit.set.done.verbose": "Operation completed ({0}).", "worldedit.line.changed": "{0} blocks have been changed.", "worldedit.line.invalid-type": "//line only works with cuboid selections or convex polyhedral selections",