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 IBlockState |
convertArgToBlockState(Block p_190794_0_,
java.lang.String p_190794_1_) |
static com.google.common.base.Predicate<IBlockState> |
convertArgToBlockStatePredicate(Block p_190791_0_,
java.lang.String p_190791_1_) |
static boolean |
doesStringStartWith(java.lang.String original,
java.lang.String region) |
static NBTTagCompound |
entityToNBT(Entity theEntity) |
java.util.List<java.lang.String> |
getAliases() |
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_) |
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) |
static java.util.List<EntityPlayerMP> |
getPlayers(MinecraftServer p_193513_0_,
ICommandSender p_193513_1_,
java.lang.String p_193513_2_) |
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> |
getTabCompletions(MinecraftServer server,
ICommandSender sender,
java.lang.String[] args,
BlockPos targetPos) |
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) |
protected static SyntaxErrorException toSyntaxException(com.google.gson.JsonParseException e)
public static NBTTagCompound entityToNBT(Entity theEntity)
public int getRequiredPermissionLevel()
public java.util.List<java.lang.String> getAliases()
getAliases
in interface ICommand
public boolean checkPermission(MinecraftServer server, ICommandSender sender)
checkPermission
in interface ICommand
public java.util.List<java.lang.String> getTabCompletions(MinecraftServer server, ICommandSender sender, java.lang.String[] args, @Nullable BlockPos targetPos)
getTabCompletions
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 java.util.List<EntityPlayerMP> getPlayers(MinecraftServer p_193513_0_, ICommandSender p_193513_1_, java.lang.String p_193513_2_) throws CommandException
CommandException
public static EntityPlayerMP getPlayer(MinecraftServer server, ICommandSender sender, java.lang.String target) throws PlayerNotFoundException, CommandException
public static Entity getEntity(MinecraftServer server, ICommandSender sender, java.lang.String target) throws EntityNotFoundException, CommandException
public static <T extends Entity> T getEntity(MinecraftServer server, ICommandSender sender, java.lang.String target, java.lang.Class<? extends T> targetClass) throws EntityNotFoundException, CommandException
public static java.util.List<Entity> getEntityList(MinecraftServer server, ICommandSender sender, java.lang.String target) throws EntityNotFoundException, CommandException
public static java.lang.String getPlayerName(MinecraftServer server, ICommandSender sender, java.lang.String target) throws PlayerNotFoundException, CommandException
public static java.lang.String getEntityName(MinecraftServer server, ICommandSender sender, java.lang.String target) throws EntityNotFoundException, CommandException
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, CommandException
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 IBlockState convertArgToBlockState(Block p_190794_0_, java.lang.String p_190794_1_) throws NumberInvalidException, InvalidBlockStateException
public static com.google.common.base.Predicate<IBlockState> convertArgToBlockStatePredicate(Block p_190791_0_, java.lang.String p_190791_1_) throws InvalidBlockStateException
InvalidBlockStateException
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)
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)