This commit is contained in:
Wizjany
2011-09-17 18:57:34 -04:00
parent f7c5782fa9
commit 1c4c621500
11 changed files with 132 additions and 497 deletions

View File

@ -95,6 +95,7 @@ public class ChunkCommands {
LocalSession session, LocalPlayer player, EditSession editSession)
throws WorldEditException {
player.print("Note that this command does not yet support the mcregion format.");
LocalConfiguration config = we.getConfiguration();
Set<Vector2D> chunks = session.getSelection(player.getWorld()).getChunks();

View File

@ -155,7 +155,7 @@ public class ClipboardCommands {
aliases = {"/flip"},
usage = "[dir]",
flags = "p",
desc = "Flip the contents of the clipboard. To flip it around yourself, use the -p flag.",
desc = "Flip the contents of the clipboard.",
min = 0,
max = 1
)

View File

@ -104,9 +104,9 @@ public class GeneralCommands {
}
@Command(
aliases = { "/toggleplace", "toggleplace" },
aliases = {"/toggleplace", "toggleplace"},
usage = "",
desc = "",
desc = "Switch between your position and pos1 for placement",
min = 0,
max = 0
)
@ -122,7 +122,7 @@ public class GeneralCommands {
}
@Command(
aliases = { "/searchitem", "/l", "/search", "searchitem", "search" },
aliases = {"/searchitem", "/l", "/search", "searchitem", "search"},
usage = "<query>",
flags = "bi",
desc = "Search for an item",

View File

@ -36,7 +36,7 @@ import com.sk89q.worldedit.util.TreeGenerator;
public class GenerationCommands {
@Command(
aliases = {"/hcyl"},
usage = "<block> <radius> [height] ",
usage = "<block> <radius> [height]",
desc = "Generate a hollow cylinder",
min = 2,
max = 3
@ -58,7 +58,7 @@ public class GenerationCommands {
@Command(
aliases = {"/cyl"},
usage = "<block> <radius> [height] ",
usage = "<block> <radius> [height]",
desc = "Generate a cylinder",
min = 2,
max = 3
@ -80,7 +80,7 @@ public class GenerationCommands {
@Command(
aliases = {"/hsphere"},
usage = "<block> <radius>[,<radius>,<radius>] [raised?] ",
usage = "<block> <radius>[,<radius>,<radius>] [raised?]",
desc = "Generate a hollow sphere.",
flags = "q",
min = 2,
@ -152,7 +152,7 @@ public class GenerationCommands {
@Command(
aliases = {"/sphere"},
usage = "<block> <radius>[,<radius>,<radius>] [raised?] ",
usage = "<block> <radius>[,<radius>,<radius>] [raised?]",
desc = "Generate a filled sphere.",
flags = "q",
min = 2,

View File

@ -103,7 +103,7 @@ public class HistoryCommands {
}
@Command(
aliases = { "/clearhistory", "clearhistory" },
aliases = {"/clearhistory", "clearhistory"},
usage = "",
desc = "Clear your history",
min = 0,

View File

@ -33,7 +33,7 @@ import com.sk89q.worldedit.*;
*/
public class NavigationCommands {
@Command(
aliases = {"unstuck"},
aliases = {"unstuck", "!"},
usage = "",
desc = "Escape from being stuck inside a block",
min = 0,

View File

@ -171,7 +171,7 @@ public class SelectionCommands {
aliases = {"/chunk"},
usage = "",
flags = "s",
desc = "Set the selection to your current chunk. The -s flag extends your current selection to the encompassed chunks.",
desc = "Set the selection to your current chunk.",
min = 0,
max = 0
)
@ -575,16 +575,19 @@ public class SelectionCommands {
}
@Command(
aliases = {"/sel", ","},
aliases = {"/sel", ";"},
usage = "[type]",
desc = "Choose a region selector",
min = 1,
min = 0,
max = 1
)
public static void select(CommandContext args, WorldEdit we,
LocalSession session, LocalPlayer player, EditSession editSession)
throws WorldEditException {
if (args.length() == 0) {
session.getRegionSelector(player.getWorld()).clear();
}
String typeName = args.getString(0);
if (typeName.equalsIgnoreCase("cuboid")) {
session.setRegionSelector(player.getWorld(), new CuboidRegionSelector());

View File

@ -40,7 +40,7 @@ import com.sk89q.worldedit.regions.Region;
public class UtilityCommands {
@Command(
aliases = {"/fill"},
usage = " <block> <radius> [depth] ",
usage = "<block> <radius> [depth]",
desc = "Fill a hole",
min = 2,
max = 3
@ -70,7 +70,7 @@ public class UtilityCommands {
@Command(
aliases = {"/fillr"},
usage = " <block> <radius> [depth] ",
usage = "<block> <radius> [depth]",
desc = "Fill a hole recursively",
min = 2,
max = 3
@ -119,7 +119,7 @@ public class UtilityCommands {
}
@Command(
aliases = { "/fixlava", "fixlava" },
aliases = {"/fixlava", "fixlava"},
usage = "<radius>",
desc = "Fix lava to be stationary",
min = 1,
@ -139,7 +139,7 @@ public class UtilityCommands {
}
@Command(
aliases = { "/fixwater", "fixwater" },
aliases = {"/fixwater", "fixwater"},
usage = "<radius>",
desc = "Fix water to be stationary",
min = 1,
@ -159,9 +159,9 @@ public class UtilityCommands {
}
@Command(
aliases = { "/removeabove", "removeabove" },
usage = "[size] [height] ",
desc = "Remove blocks above your head. ",
aliases = {"/removeabove", "removeabove"},
usage = "[size] [height]",
desc = "Remove blocks above your head.",
min = 0,
max = 2
)
@ -181,9 +181,9 @@ public class UtilityCommands {
}
@Command(
aliases = { "/removebelow", "removebelow" },
aliases = {"/removebelow", "removebelow"},
usage = "[size] [height] ",
desc = "Remove blocks below your head. ",
desc = "Remove blocks below you.",
min = 0,
max = 2
)
@ -203,8 +203,8 @@ public class UtilityCommands {
}
@Command(
aliases = { "/removenear", "removenear" },
usage = "<block> [size] ",
aliases = {"/removenear", "removenear"},
usage = "<block> [size]",
desc = "Remove blocks near you.",
min = 1,
max = 2
@ -225,8 +225,8 @@ public class UtilityCommands {
}
@Command(
aliases = { "/replacenear", "replacenear" },
usage = "<size> <from-id> <to-id> ",
aliases = {"/replacenear", "replacenear"},
usage = "<size> <from-id> <to-id>",
desc = "Replace nearby blocks",
min = 3,
max = 3
@ -263,7 +263,7 @@ public class UtilityCommands {
}
@Command(
aliases = { "/snow", "snow" },
aliases = {"/snow", "snow"},
usage = "[radius]",
desc = "Simulates snow",
min = 0,
@ -282,7 +282,7 @@ public class UtilityCommands {
}
@Command(
aliases = { "/thaw", "thaw" },
aliases = {"/thaw", "thaw"},
usage = "[radius]",
desc = "Thaws the area",
min = 0,
@ -301,7 +301,7 @@ public class UtilityCommands {
}
@Command(
aliases = { "/green", "green" },
aliases = {"/green", "green"},
usage = "[radius]",
desc = "Greens the area",
min = 0,
@ -320,7 +320,7 @@ 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,

View File

@ -179,14 +179,14 @@ public class DocumentationPrinter {
if (!method.isAnnotationPresent(Command.class)) {
continue;
}
Command cmd = method.getAnnotation(Command.class);
stream.println(" " + cmd.aliases()[0] + ":");
stream.println(" description: " + cmd.desc());
stream.println(" usage: /<command> "
+ (cmd.flags().length() > 0 ? "[-" + cmd.flags() + "] " : "")
+ cmd.usage());
stream.println(" usage: /<command>"
+ (cmd.flags().length() > 0 ? " [-" + cmd.flags() + "]" : "")
+ " " + cmd.usage());
if (cmd.aliases().length > 1) {
stream.println(" aliases: ["
+ StringUtil.joinQuotedString(cmd.aliases(), ", ", 1, "'")
@ -200,5 +200,10 @@ public class DocumentationPrinter {
+ StringUtil.joinQuotedString(cmdPerms.value(), ", ", 0, "'"));
}
}
stream.println();
stream.println();
stream.println("# Permissions aren't here. Read http://wiki.sk89q.com/wiki/WEPIF/DinnerPerms");
stream.println("# for how WorldEdit permissions actually work.");
}
}