T - The type of the enumpublic static class ArgumentType.FilteredEnumArgumentType<T extends Enum<T>> extends ArgumentType.EnumArgumentType<T>
ArgumentType that parses to a filtered enumArgumentType.EnumArgumentType<T extends Enum<T>>, ArgumentType.FilteredEnumArgumentType<T extends Enum<T>>BLOCK, BOOLEAN, COMMAND, DOUBLE, ENTITY, INTEGER, ITEM, LIVING_ENTITY, LOOT_TABLE, MATERIAL, NAME, NATURAL_NUMBER, PLAYER, SPAWNABLE_ENTITY, UUID, VECTOR, WORD, WORLD| Constructor and Description |
|---|
FilteredEnumArgumentType(@NotNull Class<T> enumClass,
Predicate<T> filter,
String enumName)
Creates a new
ArgumentType |
| Modifier and Type | Method and Description |
|---|---|
@NotNull List<String> |
getTabComplete(@NotNull CommandContext context)
Gets the tabcomplete for this
ArgumentType |
@NotNull com.datasiqn.resultapi.Result<T,com.datasiqn.resultapi.None> |
parseWord(String word)
Parses just a single word
|
getTypeNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitparserangedInt, rangedIntpublic FilteredEnumArgumentType(@NotNull
@NotNull Class<T> enumClass,
Predicate<T> filter,
String enumName)
ArgumentTypeenumClass - The enum's classfilter - The filter that enum values must pass throughenumName - The name of the enum. This is used when displaying an error message (Invalid {enumName} '{val}'@NotNull public @NotNull com.datasiqn.resultapi.Result<T,com.datasiqn.resultapi.None> parseWord(String word)
SimpleArgumentTypeparseWord in interface SimpleArgumentType<T extends Enum<T>>parseWord in class ArgumentType.EnumArgumentType<T extends Enum<T>>word - The wordResult containing the parsed value@NotNull public @NotNull List<String> getTabComplete(@NotNull @NotNull CommandContext context)
ArgumentTypeArgumentTypegetTabComplete in interface ArgumentType<T extends Enum<T>>getTabComplete in class ArgumentType.EnumArgumentType<T extends Enum<T>>context - The command contextCopyright © 2024. All rights reserved.