E - Represents a Plugin that implements the
Commandable interfacepublic abstract class SubCommand<E extends org.bukkit.plugin.Plugin> extends Object implements Comparable<SubCommand<E>>
CommandHandler
| Modifier and Type | Field and Description |
|---|---|
protected CommandHandler<E> |
handler
The
CommandHandler responsible for this command |
protected E |
plugin
The main
Plugin instance |
| Constructor and Description |
|---|
SubCommand(E plugin,
CommandHandler<E> handler)
SubCommand constructor |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(SubCommand<E> o)
|
abstract CommandStatus |
execute(org.bukkit.command.CommandSender sender,
String... args)
Executes a relevant command grabbed from the
CommandHandler. |
abstract String |
getName()
Returns the name of the command, used for storing a
HashMap of the commands as well as the subcommand
argument |
String |
getUsage()
Returns the command usage
|
boolean |
hasPermission(org.bukkit.command.CommandSender sender,
String... tokens)
Returns a permissions check for
<plugin-name>.cmd.<subcommand-name>, can be nested into further
permissions by passing tokens to append to the end of the permission
string
TODO: Figure out catch for multiple CommandHandlers |
abstract Lang |
info()
Information about this specific command.
|
abstract List<String> |
tabComplete(org.bukkit.command.CommandSender sender,
String... args)
Returns a
List of possible strings that could be supplied for
the next argument |
protected final E extends org.bukkit.plugin.Plugin plugin
Plugin instanceprotected final CommandHandler<E extends org.bukkit.plugin.Plugin> handler
CommandHandler responsible for this commandpublic SubCommand(E plugin, CommandHandler<E> handler)
SubCommand constructorplugin - The Plugin associated with this commandhandler - The CommandHandler responsible for this commandpublic abstract CommandStatus execute(org.bukkit.command.CommandSender sender, String... args)
CommandHandler.sender - The command executorargs - The command arguments, starting after the subcommand nameCommandStatus representing the result of the commandpublic abstract List<String> tabComplete(org.bukkit.command.CommandSender sender, String... args)
List of possible strings that could be supplied for
the next argumentsender - The command "tabber"args - The command arguments, starting after the subcommand name and
contains potentially unfinished argumentsList of strings that can be supplied for the next argpublic abstract String getName()
HashMap of the commands as well as the subcommand
argumentpublic String getUsage()
SubCommandpublic abstract Lang info()
public boolean hasPermission(org.bukkit.command.CommandSender sender,
String... tokens)
<plugin-name>.cmd.<subcommand-name>, can be nested into further
permissions by passing tokens to append to the end of the permission
string
TODO: Figure out catch for multiple CommandHandlerssender - The CommandSender executing this commandtokens - Any additional tokens to append to the end of the stringtrue if they have permission, false otherwisepublic int compareTo(SubCommand<E> o)
compareTo in interface Comparable<SubCommand<E extends org.bukkit.plugin.Plugin>>o - The SubCommand to compare toCopyright © 2015. All rights reserved.