public abstract class CommandHandler extends java.lang.Object implements ICommandManager
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,ICommand> |
commandMap |
private java.util.Set<ICommand> |
commandSet |
private static org.apache.logging.log4j.Logger |
LOGGER |
Constructor and Description |
---|
CommandHandler() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String[] |
dropFirstString(java.lang.String[] input) |
int |
executeCommand(ICommandSender sender,
java.lang.String rawCommand) |
java.util.Map<java.lang.String,ICommand> |
getCommands() |
java.util.List<ICommand> |
getPossibleCommands(ICommandSender sender) |
protected abstract MinecraftServer |
getServer() |
java.util.List<java.lang.String> |
getTabCompletions(ICommandSender sender,
java.lang.String input,
BlockPos pos) |
private int |
getUsernameIndex(ICommand command,
java.lang.String[] args) |
ICommand |
registerCommand(ICommand command) |
protected boolean |
tryExecute(ICommandSender sender,
java.lang.String[] args,
ICommand command,
java.lang.String input) |
private static final org.apache.logging.log4j.Logger LOGGER
private final java.util.Map<java.lang.String,ICommand> commandMap
private final java.util.Set<ICommand> commandSet
public int executeCommand(ICommandSender sender, java.lang.String rawCommand)
executeCommand
in interface ICommandManager
protected boolean tryExecute(ICommandSender sender, java.lang.String[] args, ICommand command, java.lang.String input)
protected abstract MinecraftServer getServer()
private static java.lang.String[] dropFirstString(java.lang.String[] input)
public java.util.List<java.lang.String> getTabCompletions(ICommandSender sender, java.lang.String input, @Nullable 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
private int getUsernameIndex(ICommand command, java.lang.String[] args) throws CommandException
CommandException