mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 14:46:45 +01:00
Add wildcards to command args
This commit is contained in:
parent
7142e9e0e3
commit
808a1ed703
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.github.intellectualsites.plotsquared.plot.commands;
|
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.Command;
|
||||||
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
|
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
|
||||||
import com.github.intellectualsites.plotsquared.plot.config.Captions;
|
import com.github.intellectualsites.plotsquared.plot.config.Captions;
|
||||||
@ -19,7 +20,7 @@ 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 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 {
|
requiredType = RequiredType.PLAYER) public class Add extends Command {
|
||||||
|
|
||||||
public Add() {
|
public Add() {
|
||||||
|
@ -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 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 {
|
||||||
|
|
||||||
|
@ -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() {
|
||||||
|
@ -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 {
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ 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 you are offline",
|
||||||
category = CommandCategory.SETTINGS) public class Trust extends Command {
|
category = CommandCategory.SETTINGS) public class Trust extends Command {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user