Package com.plotsquared.core.command
Class Command
java.lang.Object
com.plotsquared.core.command.Command
- Direct Known Subclasses:
Add
,Backup
,Buy
,Clear
,DebugImportWorlds
,FlagCommand
,Grant
,Help
,HomeCommand
,Leave
,MainCommand
,Near
,SubCommand
,Toggle
,Trust
,Visit
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static enum
-
Constructor Summary
ConstructorDescriptionCommand
(Command parent, boolean isStatic, String id, String permission, RequiredType required, CommandCategory category) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canExecute
(PlotPlayer<?> player, boolean message) <T> T
boolean
checkArgs
(PlotPlayer<?> player, String[] args) void
checkTrue
(boolean mustBeTrue, Caption message, net.kyori.adventure.text.minimessage.Template... args) boolean
execute
(PlotPlayer<?> player, String[] args, RunnableVal3<Command, Runnable, Runnable> confirm, RunnableVal2<Command, Command.CommandResult> whenDone) getCommand
(Class<?> clazz) getCommand
(String arg) getCommandById
(String id) getCommands
(CommandCategory category, PlotPlayer<?> player) getCommands
(PlotPlayer<?> player) getId()
int
getMatch
(String[] args, Command cmd, PlotPlayer<?> player) Argument<?>[]
getUsage()
boolean
hasConfirmation
(PermissionHolder player) int
hashCode()
void
init
(CommandDeclaration declaration) boolean
<T> void
paginate
(PlotPlayer<?> player, List<T> c, int size, int page, RunnableVal3<Integer, T, CaptionHolder> add, String baseCommand, Caption header) void
void
sendUsage
(PlotPlayer<?> player) void
setRequiredArguments
(Argument<?>[] arguments) tab
(PlotPlayer<?> player, String[] args, boolean space) tabOf
(PlotPlayer<?> player, String[] input, boolean space, String... args) toString()
-
Constructor Details
-
Command
public Command(Command parent, boolean isStatic, String id, String permission, RequiredType required, CommandCategory category) -
Command
-
-
Method Details
-
getParent
-
getId
-
getFullId
-
getCommands
-
getCommands
-
getCommands
-
hasConfirmation
-
getAliases
-
getDescription
-
getRequiredType
-
getRequiredArguments
-
setRequiredArguments
-
init
-
register
-
getPermission
-
execute
public CompletableFuture<Boolean> execute(PlotPlayer<?> player, String[] args, RunnableVal3<Command, Runnable, throws Command.CommandExceptionRunnable> confirm, RunnableVal2<Command, Command.CommandResult> whenDone) - Parameters:
player
- Callerargs
- Argumentsconfirm
- Instance, Success, FailurewhenDone
- task to run when done- Returns:
- CompletableFuture
true
if the command executed fully,false
in any other case - Throws:
Command.CommandException
-
checkArgs
-
getMatch
-
getCommand
-
getCommand
-
getCommandById
-
canExecute
-
matches
-
getCommandString
-
sendUsage
-
getUsage
-
tabOf
public Collection<Command> tabOf(PlotPlayer<?> player, String[] input, boolean space, String... args) -
tab
-
toString
-
equals
-
hashCode
-