public abstract class CommandBase extends java.lang.Object implements ICommand
Modifier and Type | Class and Description |
---|---|
static class |
CommandBase.CoordinateArg |
Constructor and Description |
---|
CommandBase() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
buildString(java.lang.String[] args,
int startPos) |
boolean |
checkPermission(MinecraftServer server,
ICommandSender sender) |
int |
compareTo(ICommand p_compareTo_1_) |
static boolean |
doesStringStartWith(java.lang.String original,
java.lang.String region) |
protected static NBTTagCompound |
entityToNBT(Entity theEntity) |
static Block |
getBlockByText(ICommandSender sender,
java.lang.String id) |
static ITextComponent |
getChatComponentFromNthArg(ICommandSender sender,
java.lang.String[] args,
int index) |
static ITextComponent |
getChatComponentFromNthArg(ICommandSender sender,
java.lang.String[] args,
int index,
boolean p_147176_3_) |
java.util.List<java.lang.String> |
getCommandAliases() |
static EntityPlayerMP |
getCommandSenderAsPlayer(ICommandSender sender) |
static Entity |
getEntity(MinecraftServer server,
ICommandSender sender,
java.lang.String target) |
static <T extends Entity> |
getEntity(MinecraftServer server,
ICommandSender sender,
java.lang.String target,
java.lang.Class<? extends T> targetClass) |
static java.util.List<Entity> |
getEntityList(MinecraftServer server,
ICommandSender sender,
java.lang.String target) |
static java.lang.String |
getEntityName(MinecraftServer server,
ICommandSender sender,
java.lang.String target) |
static Item |
getItemByText(ICommandSender sender,
java.lang.String id) |
static java.util.List<java.lang.String> |
getListOfStringsMatchingLastWord(java.lang.String[] inputArgs,
java.util.Collection<?> possibleCompletions) |
static java.util.List<java.lang.String> |
getListOfStringsMatchingLastWord(java.lang.String[] args,
java.lang.String... possibilities) |
static EntityPlayerMP |
getPlayer(MinecraftServer server,
ICommandSender sender,
java.lang.String target) |
static java.lang.String |
getPlayerName(MinecraftServer server,
ICommandSender sender,
java.lang.String target) |
int |
getRequiredPermissionLevel() |
static java.util.List<java.lang.String> |
getTabCompletionCoordinate(java.lang.String[] inputArgs,
int index,
BlockPos pos) |
static java.util.List<java.lang.String> |
getTabCompletionCoordinateXZ(java.lang.String[] inputArgs,
int index,
BlockPos lookedPos) |
java.util.List<java.lang.String> |
getTabCompletionOptions(MinecraftServer server,
ICommandSender sender,
java.lang.String[] args,
BlockPos pos) |
boolean |
isUsernameIndex(java.lang.String[] args,
int index) |
static ITextComponent |
join(java.util.List<ITextComponent> components) |
static java.lang.String |
joinNiceString(java.lang.Object[] elements) |
static java.lang.String |
joinNiceStringFromCollection(java.util.Collection<java.lang.String> strings) |
static void |
notifyCommandListener(ICommandSender sender,
ICommand command,
int flags,
java.lang.String translationKey,
java.lang.Object... translationArgs) |
static void |
notifyCommandListener(ICommandSender sender,
ICommand command,
java.lang.String translationKey,
java.lang.Object... translationArgs) |
static BlockPos |
parseBlockPos(ICommandSender sender,
java.lang.String[] args,
int startIndex,
boolean centerBlock) |
static boolean |
parseBoolean(java.lang.String input) |
static CommandBase.CoordinateArg |
parseCoordinate(double base,
java.lang.String selectorArg,
boolean centerBlock) |
static CommandBase.CoordinateArg |
parseCoordinate(double base,
java.lang.String selectorArg,
int min,
int max,
boolean centerBlock) |
static double |
parseDouble(double base,
java.lang.String input,
boolean centerBlock) |
static double |
parseDouble(double base,
java.lang.String input,
int min,
int max,
boolean centerBlock) |
static double |
parseDouble(java.lang.String input) |
static double |
parseDouble(java.lang.String input,
double min) |
static double |
parseDouble(java.lang.String input,
double min,
double max) |
static int |
parseInt(java.lang.String input) |
static int |
parseInt(java.lang.String input,
int min) |
static int |
parseInt(java.lang.String input,
int min,
int max) |
static long |
parseLong(java.lang.String input) |
static long |
parseLong(java.lang.String input,
long min,
long max) |
static void |
setCommandListener(ICommandListener listener) |
protected static SyntaxErrorException |
toSyntaxException(com.google.gson.JsonParseException e) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, getCommandName, getCommandUsage
protected static SyntaxErrorException toSyntaxException(com.google.gson.JsonParseException e)
protected static NBTTagCompound entityToNBT(Entity theEntity)
public int getRequiredPermissionLevel()
public java.util.List<java.lang.String> getCommandAliases()
getCommandAliases
in interface ICommand
public boolean checkPermission(MinecraftServer server, ICommandSender sender)
checkPermission
in interface ICommand
public java.util.List<java.lang.String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, java.lang.String[] args, @Nullable BlockPos pos)
getTabCompletionOptions
in interface ICommand
public static int parseInt(java.lang.String input) throws NumberInvalidException
NumberInvalidException
public static int parseInt(java.lang.String input, int min) throws NumberInvalidException
NumberInvalidException
public static int parseInt(java.lang.String input, int min, int max) throws NumberInvalidException
NumberInvalidException
public static long parseLong(java.lang.String input) throws NumberInvalidException
NumberInvalidException
public static long parseLong(java.lang.String input, long min, long max) throws NumberInvalidException
NumberInvalidException
public static BlockPos parseBlockPos(ICommandSender sender, java.lang.String[] args, int startIndex, boolean centerBlock) throws NumberInvalidException
NumberInvalidException
public static double parseDouble(java.lang.String input) throws NumberInvalidException
NumberInvalidException
public static double parseDouble(java.lang.String input, double min) throws NumberInvalidException
NumberInvalidException
public static double parseDouble(java.lang.String input, double min, double max) throws NumberInvalidException
NumberInvalidException
public static boolean parseBoolean(java.lang.String input) throws CommandException
CommandException
public static EntityPlayerMP getCommandSenderAsPlayer(ICommandSender sender) throws PlayerNotFoundException
PlayerNotFoundException
public static EntityPlayerMP getPlayer(MinecraftServer server, ICommandSender sender, java.lang.String target) throws PlayerNotFoundException
PlayerNotFoundException
public static Entity getEntity(MinecraftServer server, ICommandSender sender, java.lang.String target) throws EntityNotFoundException
EntityNotFoundException
public static <T extends Entity> T getEntity(MinecraftServer server, ICommandSender sender, java.lang.String target, java.lang.Class<? extends T> targetClass) throws EntityNotFoundException
EntityNotFoundException
public static java.util.List<Entity> getEntityList(MinecraftServer server, ICommandSender sender, java.lang.String target) throws EntityNotFoundException
EntityNotFoundException
public static java.lang.String getPlayerName(MinecraftServer server, ICommandSender sender, java.lang.String target) throws PlayerNotFoundException
PlayerNotFoundException
public static java.lang.String getEntityName(MinecraftServer server, ICommandSender sender, java.lang.String target) throws EntityNotFoundException
EntityNotFoundException
public static ITextComponent getChatComponentFromNthArg(ICommandSender sender, java.lang.String[] args, int index) throws CommandException, PlayerNotFoundException
public static ITextComponent getChatComponentFromNthArg(ICommandSender sender, java.lang.String[] args, int index, boolean p_147176_3_) throws PlayerNotFoundException
PlayerNotFoundException
public static java.lang.String buildString(java.lang.String[] args, int startPos)
public static CommandBase.CoordinateArg parseCoordinate(double base, java.lang.String selectorArg, boolean centerBlock) throws NumberInvalidException
NumberInvalidException
public static CommandBase.CoordinateArg parseCoordinate(double base, java.lang.String selectorArg, int min, int max, boolean centerBlock) throws NumberInvalidException
NumberInvalidException
public static double parseDouble(double base, java.lang.String input, boolean centerBlock) throws NumberInvalidException
NumberInvalidException
public static double parseDouble(double base, java.lang.String input, int min, int max, boolean centerBlock) throws NumberInvalidException
NumberInvalidException
public static Item getItemByText(ICommandSender sender, java.lang.String id) throws NumberInvalidException
NumberInvalidException
public static Block getBlockByText(ICommandSender sender, java.lang.String id) throws NumberInvalidException
NumberInvalidException
public static java.lang.String joinNiceString(java.lang.Object[] elements)
public static ITextComponent join(java.util.List<ITextComponent> components)
public static java.lang.String joinNiceStringFromCollection(java.util.Collection<java.lang.String> strings)
public static java.util.List<java.lang.String> getTabCompletionCoordinate(java.lang.String[] inputArgs, int index, @Nullable BlockPos pos)
@Nullable public static java.util.List<java.lang.String> getTabCompletionCoordinateXZ(java.lang.String[] inputArgs, int index, @Nullable BlockPos lookedPos)
public static boolean doesStringStartWith(java.lang.String original, java.lang.String region)
public static java.util.List<java.lang.String> getListOfStringsMatchingLastWord(java.lang.String[] args, java.lang.String... possibilities)
public static java.util.List<java.lang.String> getListOfStringsMatchingLastWord(java.lang.String[] inputArgs, java.util.Collection<?> possibleCompletions)
public boolean isUsernameIndex(java.lang.String[] args, int index)
isUsernameIndex
in interface ICommand
public static void notifyCommandListener(ICommandSender sender, ICommand command, java.lang.String translationKey, java.lang.Object... translationArgs)
public static void notifyCommandListener(ICommandSender sender, ICommand command, int flags, java.lang.String translationKey, java.lang.Object... translationArgs)
public static void setCommandListener(ICommandListener listener)