|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.command.SimpleCommandMap
public class SimpleCommandMap
Field Summary | |
---|---|
protected Set<String> |
aliases
|
protected static Set<VanillaCommand> |
fallbackCommands
|
protected Map<String,Command> |
knownCommands
|
Constructor Summary | |
---|---|
SimpleCommandMap(Server server)
|
Method Summary | |
---|---|
void |
clearCommands()
Clears all registered commands. |
boolean |
dispatch(CommandSender sender,
String commandLine)
Looks for the requested command and executes it if found. |
Command |
getCommand(String name)
Gets the command registered to the specified name |
Collection<Command> |
getCommands()
|
protected Command |
getFallback(String label)
|
Set<VanillaCommand> |
getFallbackCommands()
|
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. |
void |
registerServerAliases()
|
List<String> |
tabComplete(CommandSender sender,
String cmdLine)
Looks for the requested command and executes an appropriate tab-completer if found. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Map<String,Command> knownCommands
protected final Set<String> aliases
protected static final Set<VanillaCommand> fallbackCommands
Constructor Detail |
---|
public SimpleCommandMap(Server server)
Method Detail |
---|
public void registerAll(String fallbackPrefix, List<Command> commands)
registerAll
in interface CommandMap
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 registerpublic boolean register(String fallbackPrefix, Command command)
register
in interface CommandMap
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
public boolean register(String label, String fallbackPrefix, Command command)
register
in interface CommandMap
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
protected Command getFallback(String label)
public Set<VanillaCommand> getFallbackCommands()
public boolean dispatch(CommandSender sender, String commandLine) throws CommandException
dispatch
in interface CommandMap
sender
- 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()
CommandMap
clearCommands
in interface CommandMap
public Command getCommand(String name)
CommandMap
getCommand
in interface CommandMap
name
- Name of the command to retrieve
public List<String> tabComplete(CommandSender sender, String cmdLine)
CommandMap
tabComplete
in interface CommandMap
sender
- The command's sender.cmdLine
- The entire command string to tab-complete, excluding initial slash.
public Collection<Command> getCommands()
public void registerServerAliases()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |