public abstract class CommandHandler extends java.lang.Object implements ICommandManager
Constructor and Description |
---|
CommandHandler() |
Modifier and Type | Method and Description |
---|---|
int |
executeCommand(ICommandSender sender,
java.lang.String rawCommand)
Attempt to execute a command.
|
java.util.Map<java.lang.String,ICommand> |
getCommands()
Get a Map of all the name to command pairs stored in this command manager.
|
java.util.List<ICommand> |
getPossibleCommands(ICommandSender sender)
Get a list of commands that the given command sender has access to execute.
|
protected abstract MinecraftServer |
getServer() |
java.util.List<java.lang.String> |
getTabCompletions(ICommandSender sender,
java.lang.String input,
BlockPos pos)
Get a list of possible completion options for when the TAB key is pressed.
|
ICommand |
registerCommand(ICommand command)
adds the command and any aliases it has to the internal map of available commands
|
protected boolean |
tryExecute(ICommandSender sender,
java.lang.String[] args,
ICommand command,
java.lang.String input) |
public int executeCommand(ICommandSender sender, java.lang.String rawCommand)
executeCommand
in interface ICommandManager
sender
- The source of the command invocationrawCommand
- The raw string that was typedprotected boolean tryExecute(ICommandSender sender, java.lang.String[] args, ICommand command, java.lang.String input)
protected abstract MinecraftServer getServer()
public ICommand registerCommand(ICommand command)
public java.util.List<java.lang.String> getTabCompletions(ICommandSender sender, java.lang.String input, BlockPos pos)
getTabCompletions
in interface ICommandManager
public java.util.List<ICommand> getPossibleCommands(ICommandSender sender)
getPossibleCommands
in interface ICommandManager
public java.util.Map<java.lang.String,ICommand> getCommands()
getCommands
in interface ICommandManager