|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CommandMap
Method Summary | |
---|---|
void |
clearCommands()
Clears all registered commands. |
boolean |
dispatch(CommandSender sender,
String cmdLine)
Looks for the requested command and executes it if found. |
Command |
getCommand(String name)
Gets the command registered to the specified name |
boolean |
register(String fallbackPrefix,
Command command)
Registers a command. |
boolean |
register(String label,
String fallbackPrefix,
Command command)
Registers a command. |
void |
registerAll(String fallbackPrefix,
List<Command> commands)
Registers all the commands belonging to a certain plugin. |
List<String> |
tabComplete(CommandSender sender,
String cmdLine)
Looks for the requested command and executes an appropriate tab-completer if found. |
Method Detail |
---|
void registerAll(String fallbackPrefix, List<Command> commands)
fallbackPrefix
- a prefix which is prepended to each command with a ':' one or more times to make the command uniquecommands
- a list of commands to registerboolean register(String label, String fallbackPrefix, Command command)
label
- the label of the command, without the '/'-prefix.fallbackPrefix
- a prefix which is prepended to the command with a ':' one or more times to make the command uniquecommand
- the command to register
boolean register(String fallbackPrefix, Command command)
fallbackPrefix
- a prefix which is prepended to the command with a ':' one or more times to make the command uniquecommand
- the command to register, from which label is determined from the command name
boolean dispatch(CommandSender sender, String cmdLine) throws CommandException
sender
- The command's sendercmdLine
- command + arguments. Example: "/test abc 123"
CommandException
- Thrown when the executor for the given command fails with an unhandled exceptionvoid clearCommands()
Command getCommand(String name)
name
- Name of the command to retrieve
List<String> tabComplete(CommandSender sender, String cmdLine) throws IllegalArgumentException
sender
- The command's sender.cmdLine
- The entire command string to tab-complete, excluding initial slash.
CommandException
- Thrown when the tab-completer for the given command fails with an unhandled exception
IllegalArgumentException
- if either sender or cmdLine are null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |