public class SimpleCommandMap extends Object implements CommandMap
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected Map<String,Command> |
knownCommands |
| コンストラクタと説明 |
|---|
SimpleCommandMap(Server server) |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
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() |
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() |
void |
setFallbackCommands() |
List<String> |
tabComplete(CommandSender sender,
String cmdLine)
Looks for the requested command and executes an appropriate
tab-completer if found.
|
public SimpleCommandMap(Server server)
public void setFallbackCommands()
public void registerAll(String fallbackPrefix, List<Command> commands)
Caller can use:-
registerAll インタフェース内 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(String fallbackPrefix, Command command)
Caller can use:-
register インタフェース内 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(String label, String fallbackPrefix, Command command)
Caller can use:-
register インタフェース内 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, String commandLine) throws CommandException
dispatch インタフェース内 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 インタフェース内 CommandMappublic Command getCommand(String name)
CommandMapgetCommand インタフェース内 CommandMapname - Name of the command to retrievepublic List<String> tabComplete(CommandSender sender, String cmdLine)
CommandMaptabComplete インタフェース内 CommandMapsender - The command's sender.cmdLine - The entire command string to tab-complete, excluding
initial slash.public Collection<Command> getCommands()
public void registerServerAliases()
Copyright © 2016. All rights reserved.