CommandMappublic class SimpleCommandMap extends java.lang.Object implements CommandMap
| Modifier and Type | Field | Description | 
|---|---|---|
| protected java.util.Map<java.lang.String,Command> | knownCommands | 
| Constructor | Description | 
|---|---|
| SimpleCommandMap(Server server) | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | clearCommands() | Clears all registered commands. | 
| boolean | dispatch(CommandSender sender,
        java.lang.String commandLine) | Looks for the requested command and executes it if found. | 
| Command | getCommand(java.lang.String name) | Gets the command registered to the specified name | 
| java.util.Collection<Command> | getCommands() | |
| java.util.Map<java.lang.String,Command> | getKnownCommands() | Return a Map of known commands | 
| boolean | register(java.lang.String label,
        java.lang.String fallbackPrefix,
        Command command) | Registers a command. | 
| boolean | register(java.lang.String fallbackPrefix,
        Command command) | Registers a command. | 
| void | registerAll(java.lang.String fallbackPrefix,
           java.util.List<Command> commands) | Registers all the commands belonging to a certain plugin. | 
| void | registerServerAliases() | |
| void | setFallbackCommands() | |
| java.util.List<java.lang.String> | tabComplete(CommandSender sender,
           java.lang.String cmdLine) | Looks for the requested command and executes an appropriate
 tab-completer if found. | 
| java.util.List<java.lang.String> | tabComplete(CommandSender sender,
           java.lang.String cmdLine,
           Location location) | Looks for the requested command and executes an appropriate
 tab-completer if found. | 
protected final java.util.Map<java.lang.String,Command> knownCommands
public SimpleCommandMap(Server server)
public void setFallbackCommands()
public void registerAll(java.lang.String fallbackPrefix,
                        java.util.List<Command> commands)
Caller can use:-
registerAll in interface CommandMapfallbackPrefix - a prefix which is prepended to each command with
     a ':' one or more times to make the command uniquecommands - a list of commands to registerpublic boolean register(java.lang.String fallbackPrefix,
                        Command command)
Caller can use:-
register in interface CommandMapfallbackPrefix - 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 namepublic boolean register(java.lang.String label,
                        java.lang.String fallbackPrefix,
                        Command command)
Caller can use:-
register in interface CommandMaplabel - 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 registerpublic boolean dispatch(CommandSender sender, java.lang.String commandLine) throws CommandException
dispatch in interface CommandMapsender - The command's sendercommandLine - command + arguments. Example: "/test abc 123"CommandException - Thrown when the executor for the given command
     fails with an unhandled exceptionpublic void clearCommands()
CommandMapclearCommands in interface CommandMappublic Command getCommand(java.lang.String name)
CommandMapgetCommand in interface CommandMapname - Name of the command to retrievepublic java.util.List<java.lang.String> tabComplete(CommandSender sender, java.lang.String cmdLine)
CommandMaptabComplete in interface CommandMapsender - The command's sender.cmdLine - The entire command string to tab-complete, excluding
     initial slash.public java.util.List<java.lang.String> tabComplete(CommandSender sender, java.lang.String cmdLine, Location location)
CommandMaptabComplete in interface CommandMapsender - The command's sender.cmdLine - The entire command string to tab-complete, excluding
     initial slash.location - The position looked at by the sender, or null if nonepublic java.util.Collection<Command> getCommands()
public void registerServerAliases()
public java.util.Map<java.lang.String,Command> getKnownCommands()
CommandMapgetKnownCommands in interface CommandMapCopyright © 2018. All rights reserved.