|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bukkit.command.Command
org.bukkit.command.PluginCommand
public final class PluginCommand
Represents a Command belonging to a plugin
| Field Summary |
|---|
| Fields inherited from class org.bukkit.command.Command |
|---|
description, usageMessage |
| Constructor Summary | |
|---|---|
protected |
PluginCommand(String name,
Plugin owner)
|
| Method Summary | |
|---|---|
boolean |
execute(CommandSender sender,
String commandLabel,
String[] args)
Executes the command, returning its success |
CommandExecutor |
getExecutor()
Gets the CommandExecutor associated with this command |
Plugin |
getPlugin()
Gets the owner of this PluginCommand |
TabCompleter |
getTabCompleter()
Gets the TabCompleter associated with this command. |
void |
setExecutor(CommandExecutor executor)
Sets the CommandExecutor to run when parsing this command |
void |
setTabCompleter(TabCompleter completer)
Sets the TabCompleter to run when tab-completing this command. |
List<String> |
tabComplete(CommandSender sender,
String alias,
String[] args)
Executed on tab completion for this command, returning a list of options the player can tab through. |
String |
toString()
|
| Methods inherited from class org.bukkit.command.Command |
|---|
broadcastCommandMessage, broadcastCommandMessage, getAliases, getDescription, getLabel, getName, getPermission, getPermissionMessage, getUsage, isRegistered, register, setAliases, setDescription, setLabel, setPermission, setPermissionMessage, setUsage, tabComplete, testPermission, testPermissionSilent, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected PluginCommand(String name,
Plugin owner)
| Method Detail |
|---|
public boolean execute(CommandSender sender,
String commandLabel,
String[] args)
execute in class Commandsender - Source object which is executing this commandcommandLabel - The alias of the command usedargs - All arguments passed to the command, split via ' '
public void setExecutor(CommandExecutor executor)
CommandExecutor to run when parsing this command
executor - New executor to runpublic CommandExecutor getExecutor()
CommandExecutor associated with this command
public void setTabCompleter(TabCompleter completer)
TabCompleter to run when tab-completing this command.
If no TabCompleter is specified, and the command's executor implements TabCompleter, then the executor will be used for tab completion.
completer - New tab completerpublic TabCompleter getTabCompleter()
TabCompleter associated with this command.
public Plugin getPlugin()
getPlugin in interface PluginIdentifiableCommand
public List<String> tabComplete(CommandSender sender,
String alias,
String[] args)
throws CommandException,
IllegalArgumentException
TabCompleter. If a non-null list has not
been found, will default to standard player name completion in
Command.tabComplete(CommandSender, String, String[]).
tabComplete in class Commandsender - Source object which is executing this commandalias - the alias being usedargs - All arguments passed to the command, split via ' '
CommandException - if the completer or executor throw an exception during the process of tab-completing.
IllegalArgumentException - if sender, alias, or args is nullpublic String toString()
toString in class Command
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||