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) {
if (args.length == 0) {
Captions.COMMAND_SYNTAX.send(player, "/plot alias <set|remove> <value>");
Captions.COMMAND_SYNTAX.send(player, getUsage());
return false;
}
@ -64,7 +64,7 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
}
break;
default:
Captions.COMMAND_SYNTAX.send(player, "/plot alias <set|remove> <alias>");
Captions.COMMAND_SYNTAX.send(player, getUsage());
result = false;
}

View File

@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
@CommandDeclaration(command = "condense", permission = "plots.admin",
usage = "/plot condense <area> <start|stop|info> [radius]",
description = "Condense a plotworld", category = CommandCategory.ADMINISTRATION,
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) {
if (args.length != 2 && args.length != 3) {
MainUtil.sendMessage(player, "/plot condense <area> <start|stop|info> [radius]");
MainUtil.sendMessage(player, getUsage());
return false;
}
PlotArea area = PlotSquared.get().getPlotAreaByString(args[0]);

View File

@ -12,7 +12,7 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
@CommandDeclaration(command = "continue",
description = "Continue a plot that was previously marked as done",
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) {
Plot plot = player.getCurrentPlot();

View File

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

View File

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

View File

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

View File

@ -17,7 +17,7 @@ import java.util.UUID;
@CommandDeclaration(command = "setowner", permission = "plots.set.owner",
description = "Set the plot owner", usage = "/plot setowner <player>",
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) {
Set<Plot> plots = plot.getConnectedPlots();

View File

@ -25,7 +25,7 @@ import java.util.UUID;
@CommandDeclaration(command = "schematic", permission = "plots.schematic",
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 {
private boolean running = false;

View File

@ -113,8 +113,7 @@ import java.util.zip.ZipOutputStream;
return true;
}
}
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX,
"/plot template <import|export> <world> [template]");
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, getUsage());
return true;
}
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;
@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,
category = CommandCategory.SETTINGS) public class Toggle extends Command {
public Toggle() {
super(MainCommand.getInstance(), true);
}
@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,
RunnableVal3<Command, Runnable, Runnable> confirm,
RunnableVal2<Command, CommandResult> whenDone) {