From 28941b86bad540a636b8f91b8ea663a4cbcea13b Mon Sep 17 00:00:00 2001 From: sk89q Date: Fri, 18 Feb 2011 15:23:22 -0800 Subject: [PATCH] Changed super pickaxe mode command to /sp. --- plugin.yml | 4 +- .../worldedit/commands/BrushModeCommands.java | 67 ----------------- .../worldedit/commands/ToolUtilCommands.java | 2 +- .../sk89q/worldedit/tools/ReplacingBrush.java | 71 ------------------- 4 files changed, 3 insertions(+), 141 deletions(-) delete mode 100644 src/com/sk89q/worldedit/commands/BrushModeCommands.java delete mode 100644 src/com/sk89q/worldedit/tools/ReplacingBrush.java diff --git a/plugin.yml b/plugin.yml index 1b102bfb4..40cabd68b 100644 --- a/plugin.yml +++ b/plugin.yml @@ -221,10 +221,10 @@ commands: description: Toggle the super pickaxe pickaxe function usage: / aliases: [','] - pickaxe: + superpickaxe: description: Select super pickaxe mode usage: / - aliases: ['pa', 'spa'] + aliases: ['pickaxe', 'sp'] mask: description: Set the brush mask usage: / [mask] diff --git a/src/com/sk89q/worldedit/commands/BrushModeCommands.java b/src/com/sk89q/worldedit/commands/BrushModeCommands.java deleted file mode 100644 index ab40770c3..000000000 --- a/src/com/sk89q/worldedit/commands/BrushModeCommands.java +++ /dev/null @@ -1,67 +0,0 @@ -// $Id$ -/* - * WorldEdit - * Copyright (C) 2010, 2011 sk89q - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - -package com.sk89q.worldedit.commands; - -import com.sk89q.minecraft.util.commands.Command; -import com.sk89q.minecraft.util.commands.CommandContext; -import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.LocalPlayer; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.tools.Brush; -import com.sk89q.worldedit.tools.ReplacingBrush; - -public class BrushModeCommands { - @Command( - aliases = {"normal", "s"}, - usage = "", - desc = "Normal brush mode", - min = 0, - max = 0 - ) - @CommandPermissions({"worldedit.brush.mode.normal"}) - public static void normal(CommandContext args, WorldEdit we, - LocalSession session, LocalPlayer player, EditSession editSession) - throws WorldEditException { - - session.setRightClickMode(null); - session.setArmSwingMode(new Brush(true)); - player.print("Normal brush mode set."); - } - - @Command( - aliases = {"replace", "r"}, - usage = "", - desc = "Replace existing blocks only", - min = 0, - max = 0 - ) - @CommandPermissions({"worldedit.brush.mode.replace"}) - public static void replace(CommandContext args, WorldEdit we, - LocalSession session, LocalPlayer player, EditSession editSession) - throws WorldEditException { - - session.setRightClickMode(null); - session.setArmSwingMode(new ReplacingBrush()); - player.print("Replacing brush mode equipped."); - } -} diff --git a/src/com/sk89q/worldedit/commands/ToolUtilCommands.java b/src/com/sk89q/worldedit/commands/ToolUtilCommands.java index 0894913d0..fd8a6ed03 100644 --- a/src/com/sk89q/worldedit/commands/ToolUtilCommands.java +++ b/src/com/sk89q/worldedit/commands/ToolUtilCommands.java @@ -52,7 +52,7 @@ public class ToolUtilCommands { } @Command( - aliases = {"pickaxe", "pa", "spa"}, + aliases = {"superpickaxe", "pickaxe", "sp"}, desc = "Select super pickaxe mode" ) @NestedCommand({SuperPickaxeCommands.class}) diff --git a/src/com/sk89q/worldedit/tools/ReplacingBrush.java b/src/com/sk89q/worldedit/tools/ReplacingBrush.java deleted file mode 100644 index ceaca760b..000000000 --- a/src/com/sk89q/worldedit/tools/ReplacingBrush.java +++ /dev/null @@ -1,71 +0,0 @@ -// $Id$ -/* - * WorldEdit - * Copyright (C) 2010 sk89q - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - -package com.sk89q.worldedit.tools; - -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.bags.BlockBag; -import com.sk89q.worldedit.tools.brushes.BrushShape; - -/** - * Builds a sphere at the place being looked at. - * - * @author sk89q - */ -public class ReplacingBrush implements Tool { - public boolean act(ServerInterface server, LocalConfiguration config, - LocalPlayer player, LocalSession session, WorldVector clicked) { - WorldVector target = player.getBlockTrace(500); - - if (target == null) { - player.printError("No block in sight!"); - return true; - } - - BlockBag bag = session.getBlockBag(player); - - BrushShape shape = session.getBrushShape(); - - if (shape == null) { - player.printError("Select a brush first."); - return true; - } - - ReplacingExistingEditSession editSession = - new ReplacingExistingEditSession(server, target.getWorld(), - session.getBlockChangeLimit(), bag); - - editSession.enableReplacing(); - - try { - shape.build(editSession, target); - } catch (MaxChangedBlocksException e) { - player.printError("Max blocks change limit reached."); - } finally { - if (bag != null) { - bag.flushChanges(); - } - editSession.enableReplacing(); - session.remember(editSession); - } - - return true; - } - -}