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
Constructor and Description |
---|
CommandTreeBase() |
Modifier and Type | Method and Description |
---|---|
void |
addSubcommand(ICommand c) |
void |
execute(MinecraftServer server,
ICommandSender sender,
java.lang.String[] args)
Callback for when the command is executed
|
java.util.Map<java.lang.String,ICommand> |
getCommandMap() |
java.util.List<ICommand> |
getSortedCommandList() |
java.util.Collection<ICommand> |
getSubCommands() |
java.util.List<java.lang.String> |
getTabCompletions(MinecraftServer server,
ICommandSender sender,
java.lang.String[] args,
BlockPos pos)
Get a list of options for when the user presses the TAB key
|
boolean |
isUsernameIndex(java.lang.String[] args,
int index)
Return whether the specified command parameter index is a username parameter.
|
buildString, checkPermission, compareTo, convertArgToBlockState, convertArgToBlockStatePredicate, doesStringStartWith, entityToNBT, getAliases, getBlockByText, getChatComponentFromNthArg, getChatComponentFromNthArg, getCommandSenderAsPlayer, getEntity, getEntity, getEntityList, getEntityName, getItemByText, getListOfStringsMatchingLastWord, getListOfStringsMatchingLastWord, getPlayer, getPlayerName, getRequiredPermissionLevel, getTabCompletionCoordinate, getTabCompletionCoordinateXZ, join, joinNiceString, joinNiceStringFromCollection, notifyCommandListener, notifyCommandListener, parseBlockPos, parseBoolean, parseCoordinate, parseCoordinate, parseDouble, parseDouble, parseDouble, parseDouble, parseDouble, parseInt, parseInt, parseInt, parseLong, parseLong, setCommandListener, toSyntaxException
public void addSubcommand(ICommand c)
public java.util.Collection<ICommand> getSubCommands()
public java.util.Map<java.lang.String,ICommand> getCommandMap()
public java.util.List<ICommand> getSortedCommandList()
public java.util.List<java.lang.String> getTabCompletions(MinecraftServer server, ICommandSender sender, java.lang.String[] args, BlockPos pos)
getTabCompletions
in interface ICommand
getTabCompletions
in class CommandBase
server
- The server instancesender
- The ICommandSender to get tab completions forargs
- Any arguments that were present when TAB was pressedtargetPos
- The block that the player's mouse is over, null if the mouse is not over a blockpublic boolean isUsernameIndex(java.lang.String[] args, int index)
isUsernameIndex
in interface ICommand
isUsernameIndex
in class CommandBase
args
- The arguments of the command invocationindex
- The indexpublic void execute(MinecraftServer server, ICommandSender sender, java.lang.String[] args) throws CommandException
server
- The server instancesender
- The sender who executed the commandargs
- The arguments that were passedCommandException