Merge pull request #2660 from IntellectualSites/feature/v4/wildcards-player-args

Improve "everyone" args and update a few command messages
This commit is contained in:
NotMyFault 2020-01-10 19:40:01 +01:00 committed by GitHub
commit cadd0cd9b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 13 additions and 13 deletions

View File

@ -33,7 +33,7 @@ public abstract class Argument<T> {
} }
}; };
public static final Argument<String> PlayerName = public static final Argument<String> PlayerName =
new Argument<String>("PlayerName", "<player>") { new Argument<String>("PlayerName", "<player|*>") {
@Override public String parse(String in) { @Override public String parse(String in) {
return in.length() <= 16 ? in : null; return in.length() <= 16 ? in : null;
} }

View File

@ -18,8 +18,8 @@ import java.util.UUID;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@CommandDeclaration(command = "add", @CommandDeclaration(command = "add",
description = "Allow a user to build in a plot while you are online", description = "Allow a user to build in a plot while the plot owner is online.",
usage = "/plot add <player>", category = CommandCategory.SETTINGS, permission = "plots.add", usage = "/plot add <player|*>", category = CommandCategory.SETTINGS, permission = "plots.add",
requiredType = RequiredType.PLAYER) public class Add extends Command { requiredType = RequiredType.PLAYER) public class Add extends Command {
public Add() { public Add() {

View File

@ -46,7 +46,7 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
switch (args[0].toLowerCase()) { switch (args[0].toLowerCase()) {
case "set": case "set":
if (args.length != 2) { if (args.length != 2) {
Captions.COMMAND_SYNTAX.send(player, "/plot alias <set> <value>"); Captions.COMMAND_SYNTAX.send(player, getUsage());
return false; return false;
} }
@ -74,7 +74,7 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
private boolean setAlias(PlotPlayer player, Plot plot, String alias) { private boolean setAlias(PlotPlayer player, Plot plot, String alias) {
if (alias.isEmpty()) { if (alias.isEmpty()) {
Captions.COMMAND_SYNTAX.send(player, "/plot alias <set> <value>"); Captions.COMMAND_SYNTAX.send(player, getUsage());
return false; return false;
} }
if (alias.length() >= 50) { if (alias.length() >= 50) {

View File

@ -18,7 +18,7 @@ import com.google.common.primitives.Ints;
@CommandDeclaration(command = "claim", aliases = "c", @CommandDeclaration(command = "claim", aliases = "c",
description = "Claim the current plot you're standing on", category = CommandCategory.CLAIMING, description = "Claim the current plot you're standing on", category = CommandCategory.CLAIMING,
requiredType = RequiredType.NONE, permission = "plots.claim", usage = "/plot claim") requiredType = RequiredType.PLAYER, permission = "plots.claim", usage = "/plot claim")
public class Claim extends SubCommand { public class Claim extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) { @Override public boolean onCommand(final PlotPlayer player, String[] args) {

View File

@ -16,7 +16,7 @@ import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@CommandDeclaration(command = "clear", description = "Clear the plot you stand on", @CommandDeclaration(command = "clear", description = "Clear the plot you stand on", requiredType = RequiredType.NONE,
permission = "plots.clear", category = CommandCategory.APPEARANCE, usage = "/plot clear", permission = "plots.clear", category = CommandCategory.APPEARANCE, usage = "/plot clear",
aliases = "reset", confirmation = true) public class Clear extends Command { aliases = "reset", confirmation = true) public class Clear extends Command {

View File

@ -10,7 +10,7 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
@CommandDeclaration(command = "createroadschematic", aliases = {"crs"}, @CommandDeclaration(command = "createroadschematic", aliases = {"crs"},
category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.NONE, category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.PLAYER,
permission = "plots.createroadschematic", permission = "plots.createroadschematic",
description = "Add a road schematic to your world using the roads around your current plot", description = "Add a road schematic to your world using the roads around your current plot",
usage = "/plot createroadschematic") public class CreateRoadSchematic extends SubCommand { usage = "/plot createroadschematic") public class CreateRoadSchematic extends SubCommand {

View File

@ -19,7 +19,7 @@ import java.util.Set;
import java.util.UUID; import java.util.UUID;
@CommandDeclaration(command = "deny", aliases = {"d", "ban"}, @CommandDeclaration(command = "deny", aliases = {"d", "ban"},
description = "Deny a user from a plot", usage = "/plot deny <player>", description = "Deny a user from entering a plot", usage = "/plot deny <player|*>",
category = CommandCategory.SETTINGS, requiredType = RequiredType.PLAYER) public class Deny category = CommandCategory.SETTINGS, requiredType = RequiredType.PLAYER) public class Deny
extends SubCommand { extends SubCommand {

View File

@ -18,7 +18,7 @@ import java.util.Set;
import java.util.UUID; import java.util.UUID;
@CommandDeclaration(command = "kick", aliases = "k", description = "Kick a player from your plot", @CommandDeclaration(command = "kick", aliases = "k", description = "Kick a player from your plot",
permission = "plots.kick", usage = "/plot kick <player>", category = CommandCategory.TELEPORT, permission = "plots.kick", usage = "/plot kick <player|*>", category = CommandCategory.TELEPORT,
requiredType = RequiredType.PLAYER) public class Kick extends SubCommand { requiredType = RequiredType.PLAYER) public class Kick extends SubCommand {
public Kick() { public Kick() {

View File

@ -18,7 +18,7 @@ import java.util.Set;
import java.util.UUID; import java.util.UUID;
@CommandDeclaration(command = "remove", aliases = {"r", "untrust", "ut", "undeny", "unban", "ud"}, @CommandDeclaration(command = "remove", aliases = {"r", "untrust", "ut", "undeny", "unban", "ud"},
description = "Remove a player from a plot", usage = "/plot remove <player>", description = "Remove a player from a plot", usage = "/plot remove <player|*>",
category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE, category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE,
permission = "plots.remove") public class Remove extends SubCommand { permission = "plots.remove") public class Remove extends SubCommand {

View File

@ -18,8 +18,8 @@ import java.util.UUID;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@CommandDeclaration(command = "trust", aliases = {"t"}, requiredType = RequiredType.PLAYER, @CommandDeclaration(command = "trust", aliases = {"t"}, requiredType = RequiredType.PLAYER,
usage = "/plot trust <player>", usage = "/plot trust <player|*>",
description = "Allow a user to build in a plot and use WorldEdit while you are offline", description = "Allow a user to build in a plot and use WorldEdit while the plot owner is offline.",
category = CommandCategory.SETTINGS) public class Trust extends Command { category = CommandCategory.SETTINGS) public class Trust extends Command {
public Trust() { public Trust() {