From 0e200df5be46818f8aa38d1711bf77e712338900 Mon Sep 17 00:00:00 2001 From: sk89q Date: Thu, 29 Oct 2015 18:20:27 -0700 Subject: [PATCH] Replace //set with new command version. --- .../sk89q/worldedit/command/RegionCommands.java | 14 -------------- .../extension/platform/CommandManager.java | 2 ++ 2 files changed, 2 insertions(+), 14 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 5f82d1b55..8b43929ac 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 @@ -77,20 +77,6 @@ public class RegionCommands { this.worldEdit = worldEdit; } - @Command( - aliases = { "/set" }, - usage = "", - desc = "Set all the blocks inside the selection to a block", - min = 1, - max = 1 - ) - @CommandPermissions("worldedit.region.set") - @Logging(REGION) - public void set(Player player, LocalSession session, EditSession editSession, Pattern pattern) throws WorldEditException { - int affected = editSession.setBlocks(session.getSelection(player.getWorld()), Patterns.wrap(pattern)); - player.print(affected + " block(s) have been changed."); - } - @Command( aliases = { "/line" }, usage = " [thickness]", diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java index cb86a57b6..046d2202a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java @@ -52,6 +52,7 @@ import com.sk89q.worldedit.command.argument.TreeGeneratorParser; import com.sk89q.worldedit.command.composition.ApplyCommand; import com.sk89q.worldedit.command.composition.DeformCommand; import com.sk89q.worldedit.command.composition.PaintCommand; +import com.sk89q.worldedit.command.composition.SelectionCommand; import com.sk89q.worldedit.command.composition.ShapedBrushCommand; import com.sk89q.worldedit.event.platform.CommandEvent; import com.sk89q.worldedit.event.platform.CommandSuggestionEvent; @@ -149,6 +150,7 @@ public final class CommandManager { .registerMethods(new ToolUtilCommands(worldEdit)) .registerMethods(new ToolCommands(worldEdit)) .registerMethods(new UtilityCommands(worldEdit)) + .register(adapt(new SelectionCommand(new ApplyCommand(new ReplaceParser(), "Set all blocks within selection"), "worldedit.region.set")), "/set") .group("worldedit", "we") .describeAs("WorldEdit commands") .registerMethods(new WorldEditCommands(worldEdit))