Class AbstractCommand
java.lang.Object
com.ticxo.modelengine.api.command.AbstractCommand
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor
,org.bukkit.command.TabCompleter
,org.bukkit.command.TabExecutor
Viking-pillaged from LumineUtils
Thanks Ash :kekw:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractCommand
(AbstractCommand parent) AbstractCommand
(ModelEngineAPI plugin) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addSubCommands
(AbstractCommand... commands) String[]
Can be overridden to add aliases for the commandabstract String
getName()
abstract String
Permission node for this command.protected ModelEngineAPI
abstract boolean
Whether this command supports ConsoleCommandSenderboolean
onCommand
(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command cmd, @NotNull String label, String[] args) abstract boolean
Called when someone uses this commandonTabComplete
(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command cmd, @NotNull String label, String[] args) onTabComplete
(org.bukkit.command.CommandSender sender, String[] args) Called when someone requests tab completion for this command
-
Field Details
-
plugin
-
-
Constructor Details
-
AbstractCommand
-
AbstractCommand
-
-
Method Details
-
addSubCommands
-
onCommand
public boolean onCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command cmd, @NotNull @NotNull String label, String[] args) - Specified by:
onCommand
in interfaceorg.bukkit.command.CommandExecutor
-
onTabComplete
public List<String> onTabComplete(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command cmd, @NotNull @NotNull String label, String[] args) - Specified by:
onTabComplete
in interfaceorg.bukkit.command.TabCompleter
-
onCommand
Called when someone uses this command- Parameters:
sender
- Sender of this commandargs
- Arguments used- Returns:
- same as a normal onCommand method
-
onTabComplete
Called when someone requests tab completion for this command- Parameters:
sender
- The CommandSender who is tab-completingargs
- Tab completion arguments- Returns:
- A list of possible completions
-
getPermissionNode
Permission node for this command.- Returns:
- Permission node
-
isConsoleFriendly
public abstract boolean isConsoleFriendly()Whether this command supports ConsoleCommandSender- Returns:
- true if command can be used by console, false otherwise
-
getAliases
Can be overridden to add aliases for the command- Returns:
- List
-
getName
- Returns:
- The name of this command (or subcommand)
-
getPlugin
-