Add wildcards to command args

This commit is contained in:
NotMyFault 2020-01-10 13:35:59 +01:00
parent 7142e9e0e3
commit 808a1ed703
6 changed files with 7 additions and 6 deletions

View File

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

View File

@ -1,5 +1,6 @@
package com.github.intellectualsites.plotsquared.plot.commands;
import com.github.intellectualsites.plotsquared.commands.Argument;
import com.github.intellectualsites.plotsquared.commands.Command;
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
@ -19,7 +20,7 @@ import java.util.concurrent.CompletableFuture;
@CommandDeclaration(command = "add",
description = "Allow a user to build in a plot while you are 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 {
public Add() {

View File

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

View File

@ -18,7 +18,7 @@ import java.util.Set;
import java.util.UUID;
@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 {
public Kick() {

View File

@ -18,7 +18,7 @@ import java.util.Set;
import java.util.UUID;
@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,
permission = "plots.remove") public class Remove extends SubCommand {

View File

@ -18,7 +18,7 @@ import java.util.UUID;
import java.util.concurrent.CompletableFuture;
@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",
category = CommandCategory.SETTINGS) public class Trust extends Command {