Updating command usage formats

This commit is contained in:
NotMyFault 2019-09-04 03:01:25 +02:00
parent 08cd39749b
commit e1db27010c
10 changed files with 17 additions and 18 deletions

View File

@ -21,7 +21,7 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
@Override public boolean onCommand(PlotPlayer player, String[] args) { @Override public boolean onCommand(PlotPlayer player, String[] args) {
if (args.length == 0) { if (args.length == 0) {
Captions.COMMAND_SYNTAX.send(player, "/plot alias <set|remove> <value>"); Captions.COMMAND_SYNTAX.send(player, getUsage());
return false; return false;
} }
@ -64,7 +64,7 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
} }
break; break;
default: default:
Captions.COMMAND_SYNTAX.send(player, "/plot alias <set|remove> <alias>"); Captions.COMMAND_SYNTAX.send(player, getUsage());
result = false; result = false;
} }

View File

@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
@CommandDeclaration(command = "condense", permission = "plots.admin", @CommandDeclaration(command = "condense", permission = "plots.admin",
usage = "/plot condense <area> <start|stop|info> [radius]",
description = "Condense a plotworld", category = CommandCategory.ADMINISTRATION, description = "Condense a plotworld", category = CommandCategory.ADMINISTRATION,
requiredType = RequiredType.CONSOLE) public class Condense extends SubCommand { requiredType = RequiredType.CONSOLE) public class Condense extends SubCommand {
@ -27,7 +28,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
@Override public boolean onCommand(final PlotPlayer player, String[] args) { @Override public boolean onCommand(final PlotPlayer player, String[] args) {
if (args.length != 2 && args.length != 3) { if (args.length != 2 && args.length != 3) {
MainUtil.sendMessage(player, "/plot condense <area> <start|stop|info> [radius]"); MainUtil.sendMessage(player, getUsage());
return false; return false;
} }
PlotArea area = PlotSquared.get().getPlotAreaByString(args[0]); PlotArea area = PlotSquared.get().getPlotAreaByString(args[0]);

View File

@ -12,7 +12,7 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
@CommandDeclaration(command = "continue", @CommandDeclaration(command = "continue",
description = "Continue a plot that was previously marked as done", description = "Continue a plot that was previously marked as done",
permission = "plots.continue", category = CommandCategory.SETTINGS, permission = "plots.continue", category = CommandCategory.SETTINGS,
requiredType = RequiredType.NONE) public class Continue extends SubCommand { requiredType = RequiredType.PLAYER) public class Continue extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) { @Override public boolean onCommand(PlotPlayer player, String[] args) {
Plot plot = player.getCurrentPlot(); Plot plot = player.getCurrentPlot();

View File

@ -48,7 +48,7 @@ import java.util.Map.Entry;
@Override public boolean onCommand(final PlotPlayer player, String[] args) { @Override public boolean onCommand(final PlotPlayer player, String[] args) {
if (args.length < 1) { if (args.length < 1) {
MainUtil.sendMessage(player, "/plot database [area] <sqlite|mysql|import>"); MainUtil.sendMessage(player, getUsage());
return false; return false;
} }
List<Plot> plots; List<Plot> plots;
@ -60,7 +60,7 @@ import java.util.Map.Entry;
plots = PlotSquared.get().sortPlotsByTemp(PlotSquared.get().getPlots()); plots = PlotSquared.get().sortPlotsByTemp(PlotSquared.get().getPlots());
} }
if (args.length < 1) { if (args.length < 1) {
MainUtil.sendMessage(player, "/plot database [world] <sqlite|mysql|import>"); MainUtil.sendMessage(player, getUsage());
MainUtil.sendMessage(player, "[arg] indicates an optional argument"); MainUtil.sendMessage(player, "[arg] indicates an optional argument");
return false; return false;
} }

View File

@ -87,8 +87,7 @@ import java.util.*;
* plot flag list * plot flag list
*/ */
if (args.length == 0) { if (args.length == 0) {
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, getUsage());
"/plot flag <set|remove|add|list|info>");
return false; return false;
} }
Location loc = player.getLocation(); Location loc = player.getLocation();
@ -311,7 +310,7 @@ import java.util.*;
return true; return true;
} }
MainUtil MainUtil
.sendMessage(player, Captions.COMMAND_SYNTAX, "/plot flag <set|remove|add|list|info>"); .sendMessage(player, Captions.COMMAND_SYNTAX, getUsage());
return false; return false;
} }
} }

View File

@ -71,8 +71,7 @@ import java.util.List;
return false; return false;
} }
if (args.length == 0) { if (args.length == 0) {
sendMessage(player, Captions.COMMAND_SYNTAX, sendMessage(player, Captions.COMMAND_SYNTAX, getUsage());
"/plot inbox [inbox] [delete <index>|clear|page]");
for (final CommentInbox inbox : CommentManager.inboxes.values()) { for (final CommentInbox inbox : CommentManager.inboxes.values()) {
if (inbox.canRead(plot, player)) { if (inbox.canRead(plot, player)) {
if (!inbox.getComments(plot, new RunnableVal<List<PlotComment>>() { if (!inbox.getComments(plot, new RunnableVal<List<PlotComment>>() {
@ -172,8 +171,7 @@ import java.util.List;
try { try {
page = Integer.parseInt(args[1]); page = Integer.parseInt(args[1]);
} catch (NumberFormatException ignored) { } catch (NumberFormatException ignored) {
sendMessage(player, Captions.COMMAND_SYNTAX, sendMessage(player, Captions.COMMAND_SYNTAX, getUsage());
"/plot inbox [inbox] [delete <index>|clear|page]");
return false; return false;
} }
} }

View File

@ -17,7 +17,7 @@ import java.util.UUID;
@CommandDeclaration(command = "setowner", permission = "plots.set.owner", @CommandDeclaration(command = "setowner", permission = "plots.set.owner",
description = "Set the plot owner", usage = "/plot setowner <player>", description = "Set the plot owner", usage = "/plot setowner <player>",
aliases = {"owner", "so", "seto"}, category = CommandCategory.CLAIMING, aliases = {"owner", "so", "seto"}, category = CommandCategory.CLAIMING,
requiredType = RequiredType.NONE, confirmation = true) public class Owner extends SetCommand { requiredType = RequiredType.PLAYER, confirmation = true) public class Owner extends SetCommand {
@Override public boolean set(final PlotPlayer player, final Plot plot, String value) { @Override public boolean set(final PlotPlayer player, final Plot plot, String value) {
Set<Plot> plots = plot.getConnectedPlots(); Set<Plot> plots = plot.getConnectedPlots();

View File

@ -25,7 +25,7 @@ import java.util.UUID;
@CommandDeclaration(command = "schematic", permission = "plots.schematic", @CommandDeclaration(command = "schematic", permission = "plots.schematic",
description = "Schematic command", aliases = {"sch", "schem"}, description = "Schematic command", aliases = {"sch", "schem"},
category = CommandCategory.SCHEMATIC, usage = "/plot schematic <arg...>") category = CommandCategory.SCHEMATIC, usage = "/plot schematic <test|save|saveall|paste>")
public class SchematicCmd extends SubCommand { public class SchematicCmd extends SubCommand {
private boolean running = false; private boolean running = false;

View File

@ -113,8 +113,7 @@ import java.util.zip.ZipOutputStream;
return true; return true;
} }
} }
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, getUsage());
"/plot template <import|export> <world> [template]");
return true; return true;
} }
final String world = args[1]; final String world = args[1];

View File

@ -9,14 +9,16 @@ import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
@CommandDeclaration(command = "toggle", aliases = {"attribute"}, permission = "plots.use", @CommandDeclaration(command = "toggle", aliases = {"attribute"}, permission = "plots.use",
usage = "/plot toggle <chat|chatspy|clear-confirmation|titles|worldedit>",
description = "Toggle per user settings", requiredType = RequiredType.NONE, description = "Toggle per user settings", requiredType = RequiredType.NONE,
category = CommandCategory.SETTINGS) public class Toggle extends Command { category = CommandCategory.SETTINGS) public class Toggle extends Command {
public Toggle() { public Toggle() {
super(MainCommand.getInstance(), true); super(MainCommand.getInstance(), true);
} }
@CommandDeclaration(command = "chatspy", aliases = {"spy"}, @CommandDeclaration(command = "chatspy", aliases = {"spy"},
permission = "plots.admin.command.chat", description = "Toggle admin chat spying") permission = "plots.admin.command.chat", description = "Toggle plot chat spy")
public void chatspy(Command command, PlotPlayer player, String[] args, public void chatspy(Command command, PlotPlayer player, String[] args,
RunnableVal3<Command, Runnable, Runnable> confirm, RunnableVal3<Command, Runnable, Runnable> confirm,
RunnableVal2<Command, CommandResult> whenDone) { RunnableVal2<Command, CommandResult> whenDone) {