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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
ConstructorsConstructorDescriptionCommand(Command parent, boolean isStatic, String id, String permission, RequiredType required, CommandCategory category) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanExecute(PlotPlayer<?> player, boolean message)<T> TbooleancheckArgs(PlotPlayer<?> player, String[] args)voidcheckTrue(boolean mustBeTrue, Caption message, net.kyori.adventure.text.minimessage.Template... args)booleanexecute(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()intgetMatch(String[] args, Command cmd, PlotPlayer<?> player)Argument<?>[]getUsage()booleanhasConfirmation(PermissionHolder player)inthashCode()voidinit(CommandDeclaration declaration)boolean<T> voidpaginate(PlotPlayer<?> player, List<T> c, int size, int page, RunnableVal3<Integer,T,CaptionHolder> add, String baseCommand, Caption header)voidvoidsendUsage(PlotPlayer<?> player)voidsetRequiredArguments(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
-
paginate
public <T> void paginate(PlotPlayer<?> player, List<T> c, int size, int page, RunnableVal3<Integer,T,CaptionHolder> add, String baseCommand, Caption header) -
execute
public CompletableFuture<Boolean> execute(PlotPlayer<?> player, String[] args, RunnableVal3<Command,Runnable,Runnable> confirm, RunnableVal2<Command,Command.CommandResult> whenDone) throws Command.CommandException- 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
public int hashCode() -
checkTrue
public void checkTrue(boolean mustBeTrue, Caption message, net.kyori.adventure.text.minimessage.Template... args) -
check
public <T> T check(T object, Caption message, net.kyori.adventure.text.minimessage.Template... args)
-