Class ADPSubCommand
- java.lang.Object
-
- com.alessiodp.core.common.commands.utils.ADPSubCommand
-
- All Implemented Interfaces:
ADPExecutableCommand
public abstract class ADPSubCommand extends Object implements ADPExecutableCommand
-
-
Field Summary
Fields Modifier and Type Field Description protected @NotNull ADPCommandcommandprotected @NotNull StringcommandNameprotected Stringdescriptionprotected booleanexecutableByConsoleprotected Stringhelpprotected booleanlistedInHelpprotected @NotNull ADPMainCommandmainCommandprotected ADPPermissionpermissionprotected @NotNull ADPPluginpluginprotected Stringsyntax
-
Constructor Summary
Constructors Constructor Description ADPSubCommand()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected @NotNull StringbaseSyntax()Used to make a base of the syntax@NotNull StringgetRunCommand()Get the run command syntaxabstract voidonCommand(@NotNull CommandData commandData)Async command handlerList<String>onTabComplete(@NotNull User sender, @NotNull String[] args)Used to tab complete the commandabstract booleanpreRequisites(@NotNull CommandData commandData)Used to check player before async execution of the command handler.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.alessiodp.core.common.commands.utils.ADPExecutableCommand
getCommand, getCommandName, getConsoleSyntax, getDescription, getHelp, getSyntax, getSyntaxForUser, isExecutableByConsole, isListedInHelp
-
-
-
-
Field Detail
-
plugin
@NotNull protected final @NotNull ADPPlugin plugin
-
mainCommand
@NotNull protected final @NotNull ADPMainCommand mainCommand
-
command
@NotNull protected final @NotNull ADPCommand command
-
permission
protected final ADPPermission permission
-
commandName
@NotNull protected final @NotNull String commandName
-
executableByConsole
protected final boolean executableByConsole
-
listedInHelp
protected boolean listedInHelp
-
description
protected String description
-
help
protected String help
-
syntax
protected String syntax
-
-
Method Detail
-
preRequisites
public abstract boolean preRequisites(@NotNull @NotNull CommandData commandData)Used to check player before async execution of the command handler.- Parameters:
commandData- the command payload- Returns:
- true if the player can execute the command
-
onCommand
public abstract void onCommand(@NotNull @NotNull CommandData commandData)Async command handler- Parameters:
commandData- the command payload
-
onTabComplete
public List<String> onTabComplete(@NotNull @NotNull User sender, @NotNull @NotNull String[] args)
Used to tab complete the command- Parameters:
sender- the user that send the tab completeargs- arguments of the tab complete- Returns:
- a list of strings to tab complete
-
baseSyntax
@NotNull protected @NotNull String baseSyntax()
Used to make a base of the syntax- Returns:
- the command syntax
-
getRunCommand
@NotNull public @NotNull String getRunCommand()
Get the run command syntax- Specified by:
getRunCommandin interfaceADPExecutableCommand- Returns:
- the run command syntax
-
-