From 88b4f4de1813fc526b2a9da90930c0f4eabb39a2 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Mon, 19 Sep 2011 07:14:43 +0200 Subject: [PATCH] Cleanup. - Fixed a few warnings - Unified the formatting of the command prologue - Put down why it was deprecated in the javadoc of a deprecated method. - Gave //none a better usage line - Switchcaseified some elseifs --- .../java/com/sk89q/worldedit/LocalWorld.java | 2 - .../com/sk89q/worldedit/blocks/BlockType.java | 1 + .../worldedit/commands/BrushCommands.java | 20 ++--- .../worldedit/commands/ChunkCommands.java | 12 +-- .../worldedit/commands/ClipboardCommands.java | 32 +++---- .../worldedit/commands/GeneralCommands.java | 20 ++--- .../commands/GenerationCommands.java | 32 +++---- .../worldedit/commands/HistoryCommands.java | 12 +-- .../commands/NavigationCommands.java | 28 +++--- .../worldedit/commands/RegionCommands.java | 40 ++++----- .../worldedit/commands/ScriptingCommands.java | 9 +- .../worldedit/commands/SelectionCommands.java | 90 ++++++++++--------- .../worldedit/commands/SnapshotCommands.java | 56 +++++++----- .../commands/SnapshotUtilCommands.java | 22 +++-- .../commands/SuperPickaxeCommands.java | 12 +-- .../worldedit/commands/ToolCommands.java | 46 +++++----- .../worldedit/commands/ToolUtilCommands.java | 26 +++--- .../worldedit/commands/UtilityCommands.java | 58 ++++++------ .../worldedit/commands/WorldEditCommands.java | 10 +-- .../worldedit/tools/FloatingTreeRemover.java | 1 - 20 files changed, 273 insertions(+), 256 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/LocalWorld.java b/src/main/java/com/sk89q/worldedit/LocalWorld.java index af2cedffa..284e6bad0 100644 --- a/src/main/java/com/sk89q/worldedit/LocalWorld.java +++ b/src/main/java/com/sk89q/worldedit/LocalWorld.java @@ -22,9 +22,7 @@ package com.sk89q.worldedit; import java.util.Random; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; -import com.sk89q.worldedit.blocks.ItemType; import com.sk89q.worldedit.regions.Region; /** diff --git a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index d7a4b67d9..c1728a7f2 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -728,6 +728,7 @@ public enum BlockType { * * @param id * @return + * @deprecated This function ignores the data value. */ @Deprecated public static int getDroppedBlock(int id) { diff --git a/src/main/java/com/sk89q/worldedit/commands/BrushCommands.java b/src/main/java/com/sk89q/worldedit/commands/BrushCommands.java index 53045a6ae..bd0e55d51 100644 --- a/src/main/java/com/sk89q/worldedit/commands/BrushCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/BrushCommands.java @@ -50,14 +50,14 @@ import com.sk89q.worldedit.tools.brushes.SphereBrush; */ public class BrushCommands { @Command( - aliases = {"sphere", "s"}, + aliases = { "sphere", "s" }, usage = " [radius]", flags = "h", desc = "Choose the sphere brush", min = 1, max = 2 ) - @CommandPermissions({"worldedit.brush.sphere"}) + @CommandPermissions("worldedit.brush.sphere") public static void sphereBrush(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -87,14 +87,14 @@ public class BrushCommands { } @Command( - aliases = {"cylinder", "cyl", "c"}, + aliases = { "cylinder", "cyl", "c" }, usage = " [radius] [height]", flags = "h", desc = "Choose the cylinder brush", min = 1, max = 3 ) - @CommandPermissions({"worldedit.brush.cylinder"}) + @CommandPermissions("worldedit.brush.cylinder") public static void cylinderBrush(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -131,14 +131,14 @@ public class BrushCommands { } @Command( - aliases = {"clipboard", "copy"}, + aliases = { "clipboard", "copy" }, usage = "", flags = "a", desc = "Choose the clipboard brush", min = 0, max = 0 ) - @CommandPermissions({"worldedit.brush.clipboard"}) + @CommandPermissions("worldedit.brush.clipboard") public static void clipboardBrush(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -169,14 +169,14 @@ public class BrushCommands { } @Command( - aliases = {"smooth"}, + aliases = { "smooth" }, usage = "[size] [iterations]", flags = "n", desc = "Choose the terrain softener brush", min = 0, max = 2 ) - @CommandPermissions({"worldedit.brush.smooth"}) + @CommandPermissions("worldedit.brush.smooth") public static void smoothBrush(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -201,13 +201,13 @@ public class BrushCommands { } @Command( - aliases = {"ex", "extinguish"}, + aliases = { "ex", "extinguish" }, usage = "[radius]", desc = "Shortcut fire extinguisher brush", min = 0, max = 1 ) - @CommandPermissions({"worldedit.brush.ex"}) + @CommandPermissions("worldedit.brush.ex") public static void extinguishBrush(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { diff --git a/src/main/java/com/sk89q/worldedit/commands/ChunkCommands.java b/src/main/java/com/sk89q/worldedit/commands/ChunkCommands.java index 354c18053..58bbee869 100644 --- a/src/main/java/com/sk89q/worldedit/commands/ChunkCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/ChunkCommands.java @@ -37,13 +37,13 @@ import com.sk89q.worldedit.data.McRegionChunkStore; */ public class ChunkCommands { @Command( - aliases = {"chunkinfo"}, + aliases = { "chunkinfo" }, usage = "", desc = "Get information about the chunk that you are inside", min = 0, max = 0 ) - @CommandPermissions({"worldedit.chunkinfo"}) + @CommandPermissions("worldedit.chunkinfo") public static void chunkInfo(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -64,13 +64,13 @@ public class ChunkCommands { } @Command( - aliases = {"listchunks"}, + aliases = { "listchunks" }, usage = "", desc = "List chunks that your selection includes", min = 0, max = 0 ) - @CommandPermissions({"worldedit.listchunks"}) + @CommandPermissions("worldedit.listchunks") public static void listChunks(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -83,13 +83,13 @@ public class ChunkCommands { } @Command( - aliases = {"delchunks"}, + aliases = { "delchunks" }, usage = "", desc = "Delete chunks that your selection includes", min = 0, max = 0 ) - @CommandPermissions({"worldedit.delchunks"}) + @CommandPermissions("worldedit.delchunks") @Logging(REGION) public static void deleteChunks(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) diff --git a/src/main/java/com/sk89q/worldedit/commands/ClipboardCommands.java b/src/main/java/com/sk89q/worldedit/commands/ClipboardCommands.java index 819938244..eebe64e6d 100644 --- a/src/main/java/com/sk89q/worldedit/commands/ClipboardCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/ClipboardCommands.java @@ -39,13 +39,13 @@ import com.sk89q.worldedit.regions.Region; */ public class ClipboardCommands { @Command( - aliases = {"/copy"}, + aliases = { "/copy" }, usage = "", desc = "Copy the selection to the clipboard", min = 0, max = 0 ) - @CommandPermissions({"worldedit.clipboard.copy"}) + @CommandPermissions("worldedit.clipboard.copy") public static void copy(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -65,13 +65,13 @@ public class ClipboardCommands { } @Command( - aliases = {"/cut"}, + aliases = { "/cut" }, usage = "[leave-id]", desc = "Cut the selection to the clipboard", min = 0, max = 1 ) - @CommandPermissions({"worldedit.clipboard.cut"}) + @CommandPermissions("worldedit.clipboard.cut") @Logging(REGION) public static void cut(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -99,14 +99,14 @@ public class ClipboardCommands { } @Command( - aliases = {"/paste"}, + aliases = { "/paste" }, usage = "", flags = "ao", desc = "Paste the clipboard's contents", min = 0, max = 0 ) - @CommandPermissions({"worldedit.clipboard.paste"}) + @CommandPermissions("worldedit.clipboard.paste") @Logging(PLACEMENT) public static void paste(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -129,13 +129,13 @@ public class ClipboardCommands { } @Command( - aliases = {"/rotate"}, + aliases = { "/rotate" }, usage = "", desc = "Rotate the contents of the clipboard", min = 1, max = 1 ) - @CommandPermissions({"worldedit.clipboard.rotate"}) + @CommandPermissions("worldedit.clipboard.rotate") public static void rotate(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -152,14 +152,14 @@ public class ClipboardCommands { } @Command( - aliases = {"/flip"}, + aliases = { "/flip" }, usage = "[dir]", flags = "p", desc = "Flip the contents of the clipboard.", min = 0, max = 1 ) - @CommandPermissions({"worldedit.clipboard.flip"}) + @CommandPermissions("worldedit.clipboard.flip") public static void flip(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -173,13 +173,13 @@ public class ClipboardCommands { } @Command( - aliases = {"/load"}, + aliases = { "/load" }, usage = "", desc = "Load a schematic into your clipboard", min = 1, max = 1 ) - @CommandPermissions({"worldedit.clipboard.load"}) + @CommandPermissions("worldedit.clipboard.load") public static void load(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -210,13 +210,13 @@ public class ClipboardCommands { } @Command( - aliases = {"/save"}, + aliases = { "/save" }, usage = "", desc = "Save a schematic into your clipboard", min = 1, max = 1 ) - @CommandPermissions({"worldedit.clipboard.save"}) + @CommandPermissions("worldedit.clipboard.save") public static void save(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -254,13 +254,13 @@ public class ClipboardCommands { } @Command( - aliases = {"clearclipboard"}, + aliases = { "clearclipboard" }, usage = "", desc = "Clear your clipboard", min = 0, max = 0 ) - @CommandPermissions({"worldedit.clipboard.clear"}) + @CommandPermissions("worldedit.clipboard.clear") public static void clearClipboard(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { diff --git a/src/main/java/com/sk89q/worldedit/commands/GeneralCommands.java b/src/main/java/com/sk89q/worldedit/commands/GeneralCommands.java index 6b6f5cc92..519bf2ac2 100644 --- a/src/main/java/com/sk89q/worldedit/commands/GeneralCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/GeneralCommands.java @@ -34,13 +34,13 @@ import com.sk89q.worldedit.masks.Mask; */ public class GeneralCommands { @Command( - aliases = {"/limit"}, + aliases = { "/limit" }, usage = "", desc = "Modify block change limit", min = 1, max = 1 ) - @CommandPermissions({"worldedit.limit"}) + @CommandPermissions("worldedit.limit") public static void limit(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -62,13 +62,13 @@ public class GeneralCommands { } @Command( - aliases = {"/fast"}, + aliases = { "/fast" }, usage = "", desc = "Toggle fast mode", min = 0, max = 0 ) - @CommandPermissions({"worldedit.fast"}) + @CommandPermissions("worldedit.fast") public static void fast(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -83,13 +83,13 @@ public class GeneralCommands { } @Command( - aliases = {"/gmask", "gmask"}, + aliases = { "/gmask", "gmask" }, usage = "[mask]", desc = "Set the global mask", min = 0, max = -1 ) - @CommandPermissions({"worldedit.global-mask"}) + @CommandPermissions("worldedit.global-mask") public static void mask(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -104,7 +104,7 @@ public class GeneralCommands { } @Command( - aliases = {"/toggleplace", "toggleplace"}, + aliases = { "/toggleplace", "toggleplace" }, usage = "", desc = "Switch between your position and pos1 for placement", min = 0, @@ -122,7 +122,7 @@ public class GeneralCommands { } @Command( - aliases = {"/searchitem", "/l", "/search", "searchitem", "search"}, + aliases = { "/searchitem", "/l", "/search", "searchitem", "search" }, usage = "", flags = "bi", desc = "Search for an item", @@ -199,10 +199,10 @@ public class GeneralCommands { } @Command( - aliases = {"we", "worldedit"}, + aliases = { "we", "worldedit" }, desc = "WorldEdit commands" ) - @NestedCommand({WorldEditCommands.class}) + @NestedCommand(WorldEditCommands.class) public static void we(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { diff --git a/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java b/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java index 06cb9c6f1..686ba437e 100644 --- a/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java @@ -35,13 +35,13 @@ import com.sk89q.worldedit.util.TreeGenerator; */ public class GenerationCommands { @Command( - aliases = {"/hcyl"}, + aliases = { "/hcyl" }, usage = " [height]", desc = "Generate a hollow cylinder", min = 2, max = 3 ) - @CommandPermissions({"worldedit.generation.cylinder"}) + @CommandPermissions("worldedit.generation.cylinder") @Logging(PLACEMENT) public static void hcyl(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -57,13 +57,13 @@ public class GenerationCommands { } @Command( - aliases = {"/cyl"}, + aliases = { "/cyl" }, usage = " [height]", desc = "Generate a cylinder", min = 2, max = 3 ) - @CommandPermissions({"worldedit.generation.cylinder"}) + @CommandPermissions("worldedit.generation.cylinder") @Logging(PLACEMENT) public static void cyl(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -79,14 +79,14 @@ public class GenerationCommands { } @Command( - aliases = {"/hsphere"}, + aliases = { "/hsphere" }, usage = " [,,] [raised?]", desc = "Generate a hollow sphere.", flags = "q", min = 2, max = 3 ) - @CommandPermissions({"worldedit.generation.sphere"}) + @CommandPermissions("worldedit.generation.sphere") @Logging(PLACEMENT) public static void hsphere(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -151,14 +151,14 @@ public class GenerationCommands { } @Command( - aliases = {"/sphere"}, + aliases = { "/sphere" }, usage = " [,,] [raised?]", desc = "Generate a filled sphere.", flags = "q", min = 2, max = 3 ) - @CommandPermissions({"worldedit.generation.sphere"}) + @CommandPermissions("worldedit.generation.sphere") @Logging(PLACEMENT) public static void sphere(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -223,13 +223,13 @@ public class GenerationCommands { } @Command( - aliases = {"forestgen"}, + aliases = { "forestgen" }, usage = "[size] [type] [density]", desc = "Generate a forest", min = 0, max = 3 ) - @CommandPermissions({"worldedit.generation.forest"}) + @CommandPermissions("worldedit.generation.forest") @Logging(POSITION) public static void forestGen(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -252,13 +252,13 @@ public class GenerationCommands { } @Command( - aliases = {"pumpkins"}, + aliases = { "pumpkins" }, usage = "[size]", desc = "Generate pumpkin patches", min = 0, max = 1 ) - @CommandPermissions({"worldedit.generation.pumpkins"}) + @CommandPermissions("worldedit.generation.pumpkins") @Logging(POSITION) public static void pumpkins(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -271,13 +271,13 @@ public class GenerationCommands { } @Command( - aliases = {"/pyramid"}, + aliases = { "/pyramid" }, usage = " ", desc = "Generate a filled pyramid", min = 2, max = 2 ) - @CommandPermissions({"worldedit.generation.pyramid"}) + @CommandPermissions("worldedit.generation.pyramid") @Logging(PLACEMENT) public static void pyramid(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -294,13 +294,13 @@ public class GenerationCommands { } @Command( - aliases = {"/hpyramid"}, + aliases = { "/hpyramid" }, usage = " ", desc = "Generate a hollow pyramid", min = 2, max = 2 ) - @CommandPermissions({"worldedit.generation.pyramid"}) + @CommandPermissions("worldedit.generation.pyramid") @Logging(PLACEMENT) public static void hpyramid(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) diff --git a/src/main/java/com/sk89q/worldedit/commands/HistoryCommands.java b/src/main/java/com/sk89q/worldedit/commands/HistoryCommands.java index a938200d6..d003cd08e 100644 --- a/src/main/java/com/sk89q/worldedit/commands/HistoryCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/HistoryCommands.java @@ -31,13 +31,13 @@ import com.sk89q.worldedit.*; */ public class HistoryCommands { @Command( - aliases = {"/undo", "undo"}, + aliases = { "/undo", "undo" }, usage = "[times] [player]", desc = "Undoes the last action", min = 0, max = 2 ) - @CommandPermissions({"worldedit.history.undo"}) + @CommandPermissions("worldedit.history.undo") public static void undo(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -67,13 +67,13 @@ public class HistoryCommands { } @Command( - aliases = {"/redo", "redo"}, + aliases = { "/redo", "redo" }, usage = "[times] [player]", desc = "Redoes the last action (from history)", min = 0, max = 2 ) - @CommandPermissions({"worldedit.history.redo"}) + @CommandPermissions("worldedit.history.redo") public static void redo(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -103,13 +103,13 @@ public class HistoryCommands { } @Command( - aliases = {"/clearhistory", "clearhistory"}, + aliases = { "/clearhistory", "clearhistory" }, usage = "", desc = "Clear your history", min = 0, max = 0 ) - @CommandPermissions({"worldedit.history.clear"}) + @CommandPermissions("worldedit.history.clear") public static void clearHistory(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { diff --git a/src/main/java/com/sk89q/worldedit/commands/NavigationCommands.java b/src/main/java/com/sk89q/worldedit/commands/NavigationCommands.java index 1e3c84495..41846309b 100644 --- a/src/main/java/com/sk89q/worldedit/commands/NavigationCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/NavigationCommands.java @@ -33,13 +33,13 @@ import com.sk89q.worldedit.*; */ public class NavigationCommands { @Command( - aliases = {"unstuck", "!"}, + aliases = { "unstuck", "!" }, usage = "", desc = "Escape from being stuck inside a block", min = 0, max = 0 ) - @CommandPermissions({"worldedit.navigation.unstuck"}) + @CommandPermissions("worldedit.navigation.unstuck") public static void unstuck(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -49,13 +49,13 @@ public class NavigationCommands { } @Command( - aliases = {"ascend"}, + aliases = { "ascend" }, usage = "[# of levels]", desc = "Go up a floor", min = 0, max = 1 ) - @CommandPermissions({"worldedit.navigation.ascend"}) + @CommandPermissions("worldedit.navigation.ascend") public static void ascend(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -78,13 +78,13 @@ public class NavigationCommands { } @Command( - aliases = {"descend"}, + aliases = { "descend" }, usage = "[# of floors]", desc = "Go down a floor", min = 0, max = 1 ) - @CommandPermissions({"worldedit.navigation.descend"}) + @CommandPermissions("worldedit.navigation.descend") public static void descend(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -107,13 +107,13 @@ public class NavigationCommands { } @Command( - aliases = {"ceil"}, + aliases = { "ceil" }, usage = "[clearance]", desc = "Go to the celing", min = 0, max = 1 ) - @CommandPermissions({"worldedit.navigation.ceiling"}) + @CommandPermissions("worldedit.navigation.ceiling") @Logging(POSITION) public static void ceiling(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -130,13 +130,13 @@ public class NavigationCommands { } @Command( - aliases = {"thru"}, + aliases = { "thru" }, usage = "", desc = "Passthrough walls", min = 0, max = 0 ) - @CommandPermissions({"worldedit.navigation.thru"}) + @CommandPermissions("worldedit.navigation.thru") public static void thru(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -149,13 +149,13 @@ public class NavigationCommands { } @Command( - aliases = {"jumpto"}, + aliases = { "jumpto" }, usage = "", desc = "Teleport to a location", min = 0, max = 0 ) - @CommandPermissions({"worldedit.navigation.jumpto"}) + @CommandPermissions("worldedit.navigation.jumpto") public static void jumpTo(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -170,13 +170,13 @@ public class NavigationCommands { } @Command( - aliases = {"up"}, + aliases = { "up" }, usage = "", desc = "Go upwards some distance", min = 1, max = 1 ) - @CommandPermissions({"worldedit.navigation.up"}) + @CommandPermissions("worldedit.navigation.up") @Logging(POSITION) public static void up(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) diff --git a/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java b/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java index a75a2864a..8641596ad 100644 --- a/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java @@ -43,13 +43,13 @@ import com.sk89q.worldedit.regions.RegionOperationException; */ public class RegionCommands { @Command( - aliases = {"/set"}, + aliases = { "/set" }, usage = "", desc = "Set all the blocks inside the selection to a block", min = 1, max = 1 ) - @CommandPermissions({"worldedit.region.set"}) + @CommandPermissions("worldedit.region.set") @Logging(REGION) public static void set(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -70,14 +70,14 @@ public class RegionCommands { } @Command( - aliases = {"/replace"}, + aliases = { "/replace" }, usage = "[from-block] ", desc = "Replace all blocks in the selection with another", flags = "f", min = 1, max = 2 ) - @CommandPermissions({"worldedit.region.replace"}) + @CommandPermissions("worldedit.region.replace") @Logging(REGION) public static void replace(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -105,13 +105,13 @@ public class RegionCommands { } @Command( - aliases = {"/overlay"}, + aliases = { "/overlay" }, usage = "", desc = "Set a block on top of blocks in the region", min = 1, max = 1 ) - @CommandPermissions({"worldedit.region.overlay"}) + @CommandPermissions("worldedit.region.overlay") @Logging(REGION) public static void overlay(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -131,13 +131,13 @@ public class RegionCommands { } @Command( - aliases = {"/naturalize"}, + aliases = { "/naturalize" }, usage = "", desc = "3 layers of dirt on top then rock below", min = 0, max = 0 ) - @CommandPermissions({"worldedit.region.naturalize"}) + @CommandPermissions("worldedit.region.naturalize") @Logging(REGION) public static void naturalize(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -149,13 +149,13 @@ public class RegionCommands { } @Command( - aliases = {"/walls"}, + aliases = { "/walls" }, usage = "", desc = "Build the four sides of the selection", min = 1, max = 1 ) - @CommandPermissions({"worldedit.region.walls"}) + @CommandPermissions("worldedit.region.walls") @Logging(REGION) public static void walls(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -173,13 +173,13 @@ public class RegionCommands { } @Command( - aliases = {"/faces", "/outline"}, + aliases = { "/faces", "/outline" }, usage = "", desc = "Build the walls, ceiling, and floor of a selection", min = 1, max = 1 ) - @CommandPermissions({"worldedit.region.faces"}) + @CommandPermissions("worldedit.region.faces") @Logging(REGION) public static void faces(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -197,14 +197,14 @@ public class RegionCommands { } @Command( - aliases = {"/smooth"}, + aliases = { "/smooth" }, usage = "[iterations]", flags = "n", desc = "Smooth the elevation in the selection", min = 0, max = 1 ) - @CommandPermissions({"worldedit.region.smooth"}) + @CommandPermissions("worldedit.region.smooth") @Logging(REGION) public static void smooth(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -223,14 +223,14 @@ public class RegionCommands { } @Command( - aliases = {"/move"}, + aliases = { "/move" }, usage = "[count] [direction] [leave-id]", flags = "s", desc = "Move the contents of the selection", min = 0, max = 3 ) - @CommandPermissions({"worldedit.region.move"}) + @CommandPermissions("worldedit.region.move") @Logging(ORIENTATION_REGION) public static void move(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -269,14 +269,14 @@ public class RegionCommands { @Command( - aliases = {"/stack"}, + aliases = { "/stack" }, usage = "[count] [direction]", flags = "sa", desc = "Repeat the contents of the selection", min = 0, max = 2 ) - @CommandPermissions({"worldedit.region.stack"}) + @CommandPermissions("worldedit.region.stack") @Logging(ORIENTATION_REGION) public static void stack(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -306,13 +306,13 @@ public class RegionCommands { } @Command( - aliases = {"/regen"}, + aliases = { "/regen" }, usage = "", desc = "Regenerates the contents of the selection", min = 0, max = 0 ) - @CommandPermissions({"worldedit.regen"}) + @CommandPermissions("worldedit.regen") @Logging(REGION) public static void regenerateChunk(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) diff --git a/src/main/java/com/sk89q/worldedit/commands/ScriptingCommands.java b/src/main/java/com/sk89q/worldedit/commands/ScriptingCommands.java index 877b13ddc..c654c4468 100644 --- a/src/main/java/com/sk89q/worldedit/commands/ScriptingCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/ScriptingCommands.java @@ -34,13 +34,13 @@ import com.sk89q.worldedit.*; */ public class ScriptingCommands { @Command( - aliases = {"cs"}, + aliases = { "cs" }, usage = " [args...]", desc = "Execute a CraftScript", min = 1, max = -1 ) - @CommandPermissions({"worldedit.scripting.execute"}) + @CommandPermissions("worldedit.scripting.execute") @Logging(ALL) public static void execute(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -59,13 +59,13 @@ public class ScriptingCommands { } @Command( - aliases = {".s"}, + aliases = { ".s" }, usage = "[args...]", desc = "Execute last CraftScript", min = 0, max = -1 ) - @CommandPermissions({"worldedit.scripting.execute"}) + @CommandPermissions("worldedit.scripting.execute") @Logging(ALL) public static void executeLast(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -86,6 +86,5 @@ public class ScriptingCommands { new String[] {"js"}); we.runScript(player, f, scriptArgs); - } } diff --git a/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java b/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java index 7e5f3e9ba..f90096bc9 100644 --- a/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java @@ -40,13 +40,13 @@ import com.sk89q.worldedit.blocks.*; */ public class SelectionCommands { @Command( - aliases = {"/pos1"}, + aliases = { "/pos1" }, usage = "[coordinates]", desc = "Set position 1", min = 0, max = 1 ) - @CommandPermissions({"worldedit.selection.pos"}) + @CommandPermissions("worldedit.selection.pos") public static void pos1(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -75,13 +75,13 @@ public class SelectionCommands { } @Command( - aliases = {"/pos2"}, + aliases = { "/pos2" }, usage = "[coordinates]", desc = "Set position 2", min = 0, max = 1 ) - @CommandPermissions({"worldedit.selection.pos"}) + @CommandPermissions("worldedit.selection.pos") public static void pos2(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -112,13 +112,13 @@ public class SelectionCommands { } @Command( - aliases = {"/hpos1"}, + aliases = { "/hpos1" }, usage = "", desc = "Set position 1 to targeted block", min = 0, max = 0 ) - @CommandPermissions({"worldedit.selection.hpos"}) + @CommandPermissions("worldedit.selection.hpos") public static void hpos1(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -140,13 +140,13 @@ public class SelectionCommands { } @Command( - aliases = {"/hpos2"}, + aliases = { "/hpos2" }, usage = "", desc = "Set position 2 to targeted block", min = 0, max = 0 ) - @CommandPermissions({"worldedit.selection.hpos"}) + @CommandPermissions("worldedit.selection.hpos") public static void hpos2(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -168,14 +168,14 @@ public class SelectionCommands { } @Command( - aliases = {"/chunk"}, + aliases = { "/chunk" }, usage = "", flags = "s", desc = "Set the selection to your current chunk.", min = 0, max = 0 ) - @CommandPermissions({"worldedit.selection.chunk"}) + @CommandPermissions("worldedit.selection.chunk") public static void chunk(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -215,13 +215,13 @@ public class SelectionCommands { } @Command( - aliases = {"/wand"}, + aliases = { "/wand" }, usage = "", desc = "Get the wand object", min = 0, max = 0 ) - @CommandPermissions({"worldedit.wand"}) + @CommandPermissions("worldedit.wand") public static void wand(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -231,13 +231,13 @@ public class SelectionCommands { } @Command( - aliases = {"toggleeditwand"}, + aliases = { "toggleeditwand" }, usage = "", desc = "Toggle functionality of the edit wand", min = 0, max = 0 ) - @CommandPermissions({"worldedit.wand.toggle"}) + @CommandPermissions("worldedit.wand.toggle") public static void toggleWand(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -252,13 +252,13 @@ public class SelectionCommands { } @Command( - aliases = {"/expand"}, + aliases = { "/expand" }, usage = " [reverse-amount] ", desc = "Expand the selection area", min = 1, max = 3 ) - @CommandPermissions({"worldedit.selection.expand"}) + @CommandPermissions("worldedit.selection.expand") public static void expand(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -289,8 +289,9 @@ public class SelectionCommands { int change = args.getInteger(0); int reverseChange = 0; - // Specifying a direction - if (args.argsLength() == 2) { + switch (args.argsLength()) { + case 2: + // Either a reverse amount or a direction try { reverseChange = args.getInteger(1) * -1; dir = we.getDirection(player, "me"); @@ -298,12 +299,15 @@ public class SelectionCommands { dir = we.getDirection(player, args.getString(1).toLowerCase()); } - // Specifying a direction and a reverse amount - } else if (args.argsLength() == 3) { + break; + + case 3: + // Both reverse amount and direction reverseChange = args.getInteger(1) * -1; dir = we.getDirection(player, args.getString(2).toLowerCase()); - } else { + break; + default: dir = we.getDirection(player, "me"); } @@ -324,13 +328,13 @@ public class SelectionCommands { } @Command( - aliases = {"/contract"}, + aliases = { "/contract" }, usage = " [reverse-amount] [direction]", desc = "Contract the selection area", min = 1, max = 3 ) - @CommandPermissions({"worldedit.selection.contract"}) + @CommandPermissions("worldedit.selection.contract") public static void contract(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -339,8 +343,9 @@ public class SelectionCommands { int change = args.getInteger(0); int reverseChange = 0; - // Either a reverse amount or a direction - if (args.argsLength() == 2) { + switch (args.argsLength()) { + case 2: + // Either a reverse amount or a direction try { reverseChange = args.getInteger(1) * -1; dir = we.getDirection(player, "me"); @@ -348,12 +353,15 @@ public class SelectionCommands { dir = we.getDirection(player, args.getString(1).toLowerCase()); } - // Both reverse amount and direction - } else if (args.argsLength() == 3) { + break; + + case 3: + // Both reverse amount and direction reverseChange = args.getInteger(1) * -1; dir = we.getDirection(player, args.getString(2).toLowerCase()); - } else { + break; + default: dir = we.getDirection(player, "me"); } @@ -376,13 +384,13 @@ public class SelectionCommands { } @Command( - aliases = {"/shift"}, + aliases = { "/shift" }, usage = " [direction]", desc = "Shift the selection area", min = 1, max = 2 ) - @CommandPermissions({"worldedit.selection.shift"}) + @CommandPermissions("worldedit.selection.shift") public static void shift(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -411,14 +419,14 @@ public class SelectionCommands { } @Command( - aliases = {"/outset"}, + aliases = { "/outset" }, usage = "", desc = "Outset the selection area", flags = "hv", min = 1, max = 1 ) - @CommandPermissions({"worldedit.selection.outset"}) + @CommandPermissions("worldedit.selection.outset") public static void outset(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -450,14 +458,14 @@ public class SelectionCommands { } @Command( - aliases = {"/inset"}, + aliases = { "/inset" }, usage = "", desc = "Inset the selection area", flags = "hv", min = 1, max = 1 ) - @CommandPermissions({"worldedit.selection.inset"}) + @CommandPermissions("worldedit.selection.inset") public static void inset(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -485,13 +493,13 @@ public class SelectionCommands { } @Command( - aliases = {"/size"}, + aliases = { "/size" }, usage = "", desc = "Get information about the selection", min = 0, max = 0 ) - @CommandPermissions({"worldedit.selection.size"}) + @CommandPermissions("worldedit.selection.size") public static void size(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -513,13 +521,13 @@ public class SelectionCommands { } @Command( - aliases = {"/count"}, + aliases = { "/count" }, usage = "", desc = "Counts the number of a certain type of block", min = 1, max = 1 ) - @CommandPermissions({"worldedit.analysis.count"}) + @CommandPermissions("worldedit.analysis.count") public static void count(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -531,14 +539,14 @@ public class SelectionCommands { } @Command( - aliases = {"/distr"}, + aliases = { "/distr" }, usage = "", desc = "Get the distribution of blocks in the selection", flags = "c", min = 0, max = 0 ) - @CommandPermissions({"worldedit.analysis.distr"}) + @CommandPermissions("worldedit.analysis.distr") public static void distr(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -575,7 +583,7 @@ public class SelectionCommands { } @Command( - aliases = {"/sel", ";"}, + aliases = { "/sel", ";" }, usage = "[type]", desc = "Choose a region selector", min = 0, diff --git a/src/main/java/com/sk89q/worldedit/commands/SnapshotCommands.java b/src/main/java/com/sk89q/worldedit/commands/SnapshotCommands.java index 0f33b0041..7684fcbe1 100644 --- a/src/main/java/com/sk89q/worldedit/commands/SnapshotCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/SnapshotCommands.java @@ -42,12 +42,14 @@ public class SnapshotCommands { private static Logger logger = Logger.getLogger("Minecraft.WorldEdit"); private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); - @Command(aliases = {"list"}, - usage = "[num]", - desc = "List snapshots", - min = 0, - max = 1) - @CommandPermissions({"worldedit.snapshots.list"}) + @Command( + aliases = { "list" }, + usage = "[num]", + desc = "List snapshots", + min = 0, + max = 1 + ) + @CommandPermissions("worldedit.snapshots.list") public static void list(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -92,12 +94,14 @@ public class SnapshotCommands { } } - @Command(aliases = {"use"}, - usage = "", - desc = "Choose a snapshot to use", - min = 1, - max = 1) - @CommandPermissions({"worldedit.snapshots.restore"}) + @Command( + aliases = { "use" }, + usage = "", + desc = "Choose a snapshot to use", + min = 1, + max = 1 + ) + @CommandPermissions("worldedit.snapshots.restore") public static void use(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -135,12 +139,14 @@ public class SnapshotCommands { } } - @Command(aliases = {"before"}, - usage = "", - desc = "Choose the nearest snapshot before a date", - min = 1, - max = -1) - @CommandPermissions({"worldedit.snapshots.restore"}) + @Command( + aliases = { "before" }, + usage = "", + desc = "Choose the nearest snapshot before a date", + min = 1, + max = -1 + ) + @CommandPermissions("worldedit.snapshots.restore") public static void before(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -174,12 +180,14 @@ public class SnapshotCommands { } } - @Command(aliases = {"after"}, - usage = "", - desc = "Choose the nearest snapshot after a date", - min = 1, - max = -1) - @CommandPermissions({"worldedit.snapshots.restore"}) + @Command( + aliases = { "after" }, + usage = "", + desc = "Choose the nearest snapshot after a date", + min = 1, + max = -1 + ) + @CommandPermissions("worldedit.snapshots.restore") public static void after(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { diff --git a/src/main/java/com/sk89q/worldedit/commands/SnapshotUtilCommands.java b/src/main/java/com/sk89q/worldedit/commands/SnapshotUtilCommands.java index 672e3bd4f..1d7165279 100644 --- a/src/main/java/com/sk89q/worldedit/commands/SnapshotUtilCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/SnapshotUtilCommands.java @@ -44,20 +44,24 @@ public class SnapshotUtilCommands { private static Logger logger = Logger.getLogger("Minecraft.WorldEdit"); - @Command(aliases = {"snapshot", "snap"}, - desc = "Snapshot commands") - @NestedCommand({SnapshotCommands.class}) + @Command( + aliases = { "snapshot", "snap" }, + desc = "Snapshot commands" + ) + @NestedCommand(SnapshotCommands.class) public static void snapshot(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { } - @Command(aliases = {"restore", "/restore"}, - usage = "[snapshot]", - desc = "Restore the selection from a snapshot", - min = 0, - max = 1) - @CommandPermissions({"worldedit.snapshots.restore"}) + @Command( + aliases = { "restore", "/restore" }, + usage = "[snapshot]", + desc = "Restore the selection from a snapshot", + min = 0, + max = 1 + ) + @CommandPermissions("worldedit.snapshots.restore") public static void restore(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { diff --git a/src/main/java/com/sk89q/worldedit/commands/SuperPickaxeCommands.java b/src/main/java/com/sk89q/worldedit/commands/SuperPickaxeCommands.java index f28f4de24..6e5847ee2 100644 --- a/src/main/java/com/sk89q/worldedit/commands/SuperPickaxeCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/SuperPickaxeCommands.java @@ -34,13 +34,13 @@ import com.sk89q.worldedit.tools.SinglePickaxe; public class SuperPickaxeCommands { @Command( - aliases = {"single"}, + aliases = { "single" }, usage = "", desc = "Enable the single block super pickaxe mode", min = 0, max = 0 ) - @CommandPermissions({"worldedit.superpickaxe"}) + @CommandPermissions("worldedit.superpickaxe") public static void single(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -51,13 +51,13 @@ public class SuperPickaxeCommands { } @Command( - aliases = {"area"}, + aliases = { "area" }, usage = "", desc = "Enable the area super pickaxe pickaxe mode", min = 1, max = 1 ) - @CommandPermissions({"worldedit.superpickaxe.area"}) + @CommandPermissions("worldedit.superpickaxe.area") public static void area(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -76,13 +76,13 @@ public class SuperPickaxeCommands { } @Command( - aliases = {"recur", "recursive"}, + aliases = { "recur", "recursive" }, usage = "", desc = "Enable the recursive super pickaxe pickaxe mode", min = 1, max = 1 ) - @CommandPermissions({"worldedit.superpickaxe.recursive"}) + @CommandPermissions("worldedit.superpickaxe.recursive") public static void recursive(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { diff --git a/src/main/java/com/sk89q/worldedit/commands/ToolCommands.java b/src/main/java/com/sk89q/worldedit/commands/ToolCommands.java index 08a4ce96f..ad531ae1c 100644 --- a/src/main/java/com/sk89q/worldedit/commands/ToolCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/ToolCommands.java @@ -32,9 +32,9 @@ import com.sk89q.worldedit.util.TreeGenerator; public class ToolCommands { @Command( - aliases = {"none"}, + aliases = { "none" }, usage = "", - desc = "Turn off all superpickaxe alternate modes", + desc = "Unbind all bound tools", min = 0, max = 0 ) @@ -47,13 +47,13 @@ public class ToolCommands { } @Command( - aliases = {"info"}, + aliases = { "info" }, usage = "", desc = "Block information tool", min = 0, max = 0 ) - @CommandPermissions({"worldedit.tool.info"}) + @CommandPermissions("worldedit.tool.info") public static void info(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -64,13 +64,13 @@ public class ToolCommands { } @Command( - aliases = {"tree"}, + aliases = { "tree" }, usage = "[type]", desc = "Tree generator tool", min = 0, max = 1 ) - @CommandPermissions({"worldedit.tool.tree"}) + @CommandPermissions("worldedit.tool.tree") public static void tree(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -90,13 +90,13 @@ public class ToolCommands { } @Command( - aliases = {"repl"}, + aliases = { "repl" }, usage = "", desc = "Block replacer tool", min = 1, max = 1 ) - @CommandPermissions({"worldedit.tool.replacer"}) + @CommandPermissions("worldedit.tool.replacer") public static void repl(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -108,13 +108,13 @@ public class ToolCommands { } @Command( - aliases = {"cycler"}, + aliases = { "cycler" }, usage = "", desc = "Block data cycler tool", min = 0, max = 0 ) - @CommandPermissions({"worldedit.tool.data-cycler"}) + @CommandPermissions("worldedit.tool.data-cycler") public static void cycler(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -125,13 +125,13 @@ public class ToolCommands { } @Command( - aliases = {"floodfill", "flood"}, + aliases = { "floodfill", "flood" }, usage = " ", desc = "Flood fill tool", min = 2, max = 2 ) - @CommandPermissions({"worldedit.tool.flood-fill"}) + @CommandPermissions("worldedit.tool.flood-fill") public static void floodFill(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -151,23 +151,23 @@ public class ToolCommands { } @Command( - aliases = {"brush", "br"}, + aliases = { "brush", "br" }, desc = "Brush tool" ) - @NestedCommand({BrushCommands.class}) + @NestedCommand(BrushCommands.class) public static void brush(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { } @Command( - aliases = {"deltree"}, + aliases = { "deltree" }, usage = "", desc = "Floating tree remover tool", min = 0, max = 0 - ) - @CommandPermissions({"worldedit.tool.deltree"}) + ) + @CommandPermissions("worldedit.tool.deltree") public static void deltree(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -178,13 +178,13 @@ public class ToolCommands { } @Command( - aliases = {"farwand"}, + aliases = { "farwand" }, usage = "", desc = "Wand at a distance tool", min = 0, max = 0 - ) - @CommandPermissions({"worldedit.tool.farwand"}) + ) + @CommandPermissions("worldedit.tool.farwand") public static void farwand(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -194,13 +194,13 @@ public class ToolCommands { } @Command( - aliases = {"lrbuild", "/lrbuild"}, + aliases = { "lrbuild", "/lrbuild" }, usage = " ", desc = "Long-range building tool", min = 2, max = 2 - ) - @CommandPermissions({"worldedit.tool.lrbuild"}) + ) + @CommandPermissions("worldedit.tool.lrbuild") public static void longrangebuildtool(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { diff --git a/src/main/java/com/sk89q/worldedit/commands/ToolUtilCommands.java b/src/main/java/com/sk89q/worldedit/commands/ToolUtilCommands.java index 7c4874d73..17b5623f5 100644 --- a/src/main/java/com/sk89q/worldedit/commands/ToolUtilCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/ToolUtilCommands.java @@ -34,13 +34,13 @@ import com.sk89q.worldedit.patterns.Pattern; */ public class ToolUtilCommands { @Command( - aliases = {"/", ","}, + aliases = { "/", "," }, usage = "[on|off]", desc = "Toggle the super pickaxe pickaxe function", min = 0, max = 1 ) - @CommandPermissions({"worldedit.superpickaxe"}) + @CommandPermissions("worldedit.superpickaxe") public static void togglePickaxe(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -67,10 +67,10 @@ public class ToolUtilCommands { } @Command( - aliases = {"superpickaxe", "pickaxe", "sp"}, + aliases = { "superpickaxe", "pickaxe", "sp" }, desc = "Select super pickaxe mode" ) - @NestedCommand({SuperPickaxeCommands.class}) + @NestedCommand(SuperPickaxeCommands.class) public static void pickaxe(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -80,20 +80,20 @@ public class ToolUtilCommands { aliases = {"tool"}, desc = "Select a tool to bind" ) - @NestedCommand({ToolCommands.class}) + @NestedCommand(ToolCommands.class) public static void tool(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { } @Command( - aliases = {"mask"}, + aliases = { "mask" }, usage = "[mask]", desc = "Set the brush mask", min = 0, max = -1 ) - @CommandPermissions({"worldedit.brush.options.mask"}) + @CommandPermissions("worldedit.brush.options.mask") public static void mask(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -108,13 +108,13 @@ public class ToolUtilCommands { } @Command( - aliases = {"mat", "material", "fill"}, + aliases = { "mat", "material", "fill" }, usage = "[pattern]", desc = "Set the brush material", min = 1, max = 1 ) - @CommandPermissions({"worldedit.brush.options.material"}) + @CommandPermissions("worldedit.brush.options.material") public static void material(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -124,13 +124,13 @@ public class ToolUtilCommands { } @Command( - aliases = {"range"}, + aliases = { "range" }, usage = "[pattern]", desc = "Set the brush range", min = 1, max = 1 ) - @CommandPermissions({"worldedit.brush.options.range"}) + @CommandPermissions("worldedit.brush.options.range") public static void range(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -140,13 +140,13 @@ public class ToolUtilCommands { } @Command( - aliases = {"size"}, + aliases = { "size" }, usage = "[pattern]", desc = "Set the brush size", min = 1, max = 1 ) - @CommandPermissions({"worldedit.brush.options.size"}) + @CommandPermissions("worldedit.brush.options.size") public static void size(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { diff --git a/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java b/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java index 51334cf3a..1d2ecd0d3 100644 --- a/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java @@ -39,13 +39,13 @@ import com.sk89q.worldedit.regions.Region; */ public class UtilityCommands { @Command( - aliases = {"/fill"}, + aliases = { "/fill" }, usage = " [depth]", desc = "Fill a hole", min = 2, max = 3 ) - @CommandPermissions({"worldedit.fill"}) + @CommandPermissions("worldedit.fill") @Logging(PLACEMENT) public static void fill(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -69,13 +69,13 @@ public class UtilityCommands { } @Command( - aliases = {"/fillr"}, + aliases = { "/fillr" }, usage = " [depth]", desc = "Fill a hole recursively", min = 2, max = 3 ) - @CommandPermissions({"worldedit.fill.recursive"}) + @CommandPermissions("worldedit.fill.recursive") @Logging(PLACEMENT) public static void fillr(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -99,13 +99,13 @@ public class UtilityCommands { } @Command( - aliases = {"/drain"}, + aliases = { "/drain" }, usage = "", desc = "Drain a pool", min = 1, max = 1 ) - @CommandPermissions({"worldedit.drain"}) + @CommandPermissions("worldedit.drain") @Logging(PLACEMENT) public static void drain(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -119,13 +119,13 @@ public class UtilityCommands { } @Command( - aliases = {"/fixlava", "fixlava"}, + aliases = { "/fixlava", "fixlava" }, usage = "", desc = "Fix lava to be stationary", min = 1, max = 1 ) - @CommandPermissions({"worldedit.fixlava"}) + @CommandPermissions("worldedit.fixlava") @Logging(PLACEMENT) public static void fixLava(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -139,13 +139,13 @@ public class UtilityCommands { } @Command( - aliases = {"/fixwater", "fixwater"}, + aliases = { "/fixwater", "fixwater" }, usage = "", desc = "Fix water to be stationary", min = 1, max = 1 ) - @CommandPermissions({"worldedit.fixwater"}) + @CommandPermissions("worldedit.fixwater") @Logging(PLACEMENT) public static void fixWater(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -159,13 +159,13 @@ public class UtilityCommands { } @Command( - aliases = {"/removeabove", "removeabove"}, + aliases = { "/removeabove", "removeabove" }, usage = "[size] [height]", desc = "Remove blocks above your head.", min = 0, max = 2 ) - @CommandPermissions({"worldedit.removeabove"}) + @CommandPermissions("worldedit.removeabove") @Logging(PLACEMENT) public static void removeAbove(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -181,13 +181,13 @@ public class UtilityCommands { } @Command( - aliases = {"/removebelow", "removebelow"}, + aliases = { "/removebelow", "removebelow" }, usage = "[size] [height]", desc = "Remove blocks below you.", min = 0, max = 2 ) - @CommandPermissions({"worldedit.removebelow"}) + @CommandPermissions("worldedit.removebelow") @Logging(PLACEMENT) public static void removeBelow(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -203,13 +203,13 @@ public class UtilityCommands { } @Command( - aliases = {"/removenear", "removenear"}, + aliases = { "/removenear", "removenear" }, usage = " [size]", desc = "Remove blocks near you.", min = 1, max = 2 ) - @CommandPermissions({"worldedit.removenear"}) + @CommandPermissions("worldedit.removenear") @Logging(PLACEMENT) public static void removeNear(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -225,14 +225,14 @@ public class UtilityCommands { } @Command( - aliases = {"/replacenear", "replacenear"}, + aliases = { "/replacenear", "replacenear" }, usage = " ", desc = "Replace nearby blocks", flags = "f", min = 3, max = 3 ) - @CommandPermissions({"worldedit.replacenear"}) + @CommandPermissions("worldedit.replacenear") @Logging(PLACEMENT) public static void replaceNear(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -264,13 +264,13 @@ public class UtilityCommands { } @Command( - aliases = {"/snow", "snow"}, + aliases = { "/snow", "snow" }, usage = "[radius]", desc = "Simulates snow", min = 0, max = 1 ) - @CommandPermissions({"worldedit.snow"}) + @CommandPermissions("worldedit.snow") @Logging(PLACEMENT) public static void snow(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -289,7 +289,7 @@ public class UtilityCommands { min = 0, max = 1 ) - @CommandPermissions({"worldedit.thaw"}) + @CommandPermissions("worldedit.thaw") @Logging(PLACEMENT) public static void thaw(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -302,13 +302,13 @@ public class UtilityCommands { } @Command( - aliases = {"/green", "green"}, + aliases = { "/green", "green" }, usage = "[radius]", desc = "Greens the area", min = 0, max = 1 ) - @CommandPermissions({"worldedit.green"}) + @CommandPermissions("worldedit.green") @Logging(PLACEMENT) public static void green(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -321,13 +321,13 @@ public class UtilityCommands { } @Command( - aliases = {"/ex", "/ext", "/extinguish", "ex", "ext", "extinguish"}, + aliases = { "/ex", "/ext", "/extinguish", "ex", "ext", "extinguish" }, usage = "[radius]", desc = "Extinguish nearby fire", min = 0, max = 1 ) - @CommandPermissions({"worldedit.extinguish"}) + @CommandPermissions("worldedit.extinguish") @Logging(PLACEMENT) public static void extinguish(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -346,14 +346,14 @@ public class UtilityCommands { } @Command( - aliases = {"butcher"}, + aliases = { "butcher" }, usage = "[radius]", flags = "p", desc = "Kill all or nearby mobs", min = 0, max = 1 ) - @CommandPermissions({"worldedit.butcher"}) + @CommandPermissions("worldedit.butcher") @Logging(PLACEMENT) public static void butcher(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) @@ -368,13 +368,13 @@ public class UtilityCommands { } @Command( - aliases = {"remove", "rem", "rement"}, + aliases = { "remove", "rem", "rement" }, usage = " ", desc = "Remove all entities of a type", min = 2, max = 2 ) - @CommandPermissions({"worldedit.remove"}) + @CommandPermissions("worldedit.remove") @Logging(PLACEMENT) public static void remove(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) diff --git a/src/main/java/com/sk89q/worldedit/commands/WorldEditCommands.java b/src/main/java/com/sk89q/worldedit/commands/WorldEditCommands.java index 3a3c05803..cea659686 100644 --- a/src/main/java/com/sk89q/worldedit/commands/WorldEditCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/WorldEditCommands.java @@ -36,7 +36,7 @@ public class WorldEditCommands { private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); @Command( - aliases = {"version", "ver"}, + aliases = { "version", "ver" }, usage = "", desc = "Get WorldEdit version", min = 0, @@ -51,13 +51,13 @@ public class WorldEditCommands { } @Command( - aliases = {"reload"}, + aliases = { "reload" }, usage = "", desc = "Reload WorldEdit", min = 0, max = 0 ) - @CommandPermissions({"worldedit.reload"}) + @CommandPermissions("worldedit.reload") public static void reload(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { @@ -67,7 +67,7 @@ public class WorldEditCommands { } @Command( - aliases = {"cui"}, + aliases = { "cui" }, usage = "", desc = "Complete CUI handshake", min = 0, @@ -81,7 +81,7 @@ public class WorldEditCommands { } @Command( - aliases = {"tz"}, + aliases = { "tz" }, usage = "[timezone]", desc = "Set your timezone", min = 1, diff --git a/src/main/java/com/sk89q/worldedit/tools/FloatingTreeRemover.java b/src/main/java/com/sk89q/worldedit/tools/FloatingTreeRemover.java index d45538c0a..374dd512a 100755 --- a/src/main/java/com/sk89q/worldedit/tools/FloatingTreeRemover.java +++ b/src/main/java/com/sk89q/worldedit/tools/FloatingTreeRemover.java @@ -19,7 +19,6 @@ package com.sk89q.worldedit.tools; -import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.Set;