public abstract class CommandTreeBase extends CommandBase
E.g. /team settings set [value] settings is subcommand of team and set is subcommand of settings
CommandBase.CoordinateArg
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,ICommand> |
commandAliasMap |
private java.util.Map<java.lang.String,ICommand> |
commandMap |
Constructor and Description |
---|
CommandTreeBase() |
Modifier and Type | Method and Description |
---|---|
void |
addSubcommand(ICommand command) |
void |
execute(MinecraftServer server,
ICommandSender sender,
java.lang.String[] args) |
private java.lang.String |
getAvailableSubCommandsString(MinecraftServer server,
ICommandSender sender) |
java.util.Map<java.lang.String,ICommand> |
getCommandMap() |
java.util.List<ICommand> |
getSortedCommandList() |
ICommand |
getSubCommand(java.lang.String command) |
java.util.Collection<ICommand> |
getSubCommands() |
java.util.List<java.lang.String> |
getTabCompletions(MinecraftServer server,
ICommandSender sender,
java.lang.String[] args,
BlockPos pos) |
boolean |
isUsernameIndex(java.lang.String[] args,
int index) |
private static java.lang.String[] |
shiftArgs(java.lang.String[] s) |
buildString, checkPermission, compareTo, convertArgToBlockState, convertArgToBlockStatePredicate, doesStringStartWith, entityToNBT, getAliases, getBlockByText, getChatComponentFromNthArg, getChatComponentFromNthArg, getCommandSenderAsPlayer, getEntity, getEntity, getEntityList, getEntityName, getItemByText, getListOfStringsMatchingLastWord, getListOfStringsMatchingLastWord, getPlayer, getPlayerName, getPlayers, getRequiredPermissionLevel, getTabCompletionCoordinate, getTabCompletionCoordinateXZ, join, joinNiceString, joinNiceStringFromCollection, notifyCommandListener, notifyCommandListener, parseBlockPos, parseBoolean, parseCoordinate, parseCoordinate, parseDouble, parseDouble, parseDouble, parseDouble, parseDouble, parseInt, parseInt, parseInt, parseLong, parseLong, setCommandListener, toSyntaxException
private final java.util.Map<java.lang.String,ICommand> commandMap
private final java.util.Map<java.lang.String,ICommand> commandAliasMap
public void addSubcommand(ICommand command)
public java.util.Collection<ICommand> getSubCommands()
@Nullable public ICommand getSubCommand(java.lang.String command)
public java.util.Map<java.lang.String,ICommand> getCommandMap()
public java.util.List<ICommand> getSortedCommandList()
private static java.lang.String[] shiftArgs(@Nullable java.lang.String[] s)
public java.util.List<java.lang.String> getTabCompletions(MinecraftServer server, ICommandSender sender, java.lang.String[] args, @Nullable BlockPos pos)
getTabCompletions
in interface ICommand
getTabCompletions
in class CommandBase
public boolean isUsernameIndex(java.lang.String[] args, int index)
isUsernameIndex
in interface ICommand
isUsernameIndex
in class CommandBase
public void execute(MinecraftServer server, ICommandSender sender, java.lang.String[] args) throws CommandException
CommandException
private java.lang.String getAvailableSubCommandsString(MinecraftServer server, ICommandSender sender)