Display usage

This commit is contained in:
Jesse Boyd 2018-04-13 19:59:08 +10:00
parent 6c67192fe2
commit 39216dee42
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -483,19 +483,21 @@ public class SchematicCommands extends MethodCommands {
@Command( @Command(
aliases = {"show"}, aliases = {"show"},
desc = "Show a schematic", desc = "Show a schematic",
usage = "[global|mine|<filter>] [page=1]", usage = "[global|mine|<filter>]",
min = 0, min = 0,
max = -1, max = -1,
flags = "dnp", flags = "dnp",
help = "List all schematics in the schematics directory\n" + help = "List all schematics in the schematics directory\n" +
" -p <page> prints the requested page\n" +
" -f <format> restricts by format\n" " -f <format> restricts by format\n"
) )
@CommandPermissions("worldedit.heightmap.list") @CommandPermissions("worldedit.heightmap.list")
public void show(Player player, CommandContext args, @Switch('p') @Optional("1") int page) { public void show(Player player, CommandContext args, @Switch('f') String formatName) {
FawePlayer fp = FawePlayer.wrap(player); FawePlayer fp = FawePlayer.wrap(player);
if (args.argsLength() == 0 && fp.getSession().getVirtualWorld() != null) { if (args.argsLength() == 0) {
fp.setVirtualWorld(null); if (fp.getSession().getVirtualWorld() != null) fp.setVirtualWorld(null);
else {
BBC.COMMAND_SYNTAX.send(player, "/" + Commands.getAlias(SchematicCommands.class, "schematic") + " " + getCommand().aliases()[0] + " " + getCommand().usage());
}
return; return;
} }
LocalConfiguration config = worldEdit.getConfiguration(); LocalConfiguration config = worldEdit.getConfiguration();
@ -503,7 +505,7 @@ public class SchematicCommands extends MethodCommands {
try { try {
SchemVis visExtent = new SchemVis(fp); SchemVis visExtent = new SchemVis(fp);
LongAdder count = new LongAdder(); LongAdder count = new LongAdder();
UtilityCommands.getFiles(dir, player, args, 0, Character.MAX_VALUE, null, Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS, file -> { UtilityCommands.getFiles(dir, player, args, 0, Character.MAX_VALUE, formatName, Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS, file -> {
if (file.isFile()) { if (file.isFile()) {
try { try {
visExtent.add(file); visExtent.add(file);