Class ResourceKeyArgument<T>
java.lang.Object
net.minecraft.commands.arguments.ResourceKeyArgument<T>
- All Implemented Interfaces:
ArgumentType<ResourceKey<T>>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DynamicCommandExceptionTypeprivate static final DynamicCommandExceptionTypeprivate static final DynamicCommandExceptionTypeprivate static final DynamicCommandExceptionTypeprivate static final DynamicCommandExceptionTypeprivate static final SimpleCommandExceptionTypeprivate static final Collection<String> private final ResourceKey<? extends Registry<T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AdvancementHoldergetAdvancement(CommandContext<CommandSourceStack> context, String name) static Holder.Reference<ConfiguredFeature<?, ?>> getConfiguredFeature(CommandContext<CommandSourceStack> context, String name) static RecipeHolder<?> getRecipe(CommandContext<CommandSourceStack> context, String name) private static <T> Registry<T> getRegistry(CommandContext<CommandSourceStack> context, ResourceKey<? extends Registry<T>> registryKey) static <T> ResourceKey<T> getRegistryKey(CommandContext<CommandSourceStack> context, String name, ResourceKey<Registry<T>> registryKey, DynamicCommandExceptionType exceptionType) static Holder.Reference<Structure> getStructure(CommandContext<CommandSourceStack> context, String name) getStructureTemplatePool(CommandContext<CommandSourceStack> context, String name) static <T> ResourceKeyArgument<T> key(ResourceKey<? extends Registry<T>> key) listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) parse(StringReader reader) private static <T> Holder.Reference<T> resolveKey(CommandContext<CommandSourceStack> context, String name, ResourceKey<Registry<T>> registryKey, DynamicCommandExceptionType exception) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ArgumentType
parse
-
Field Details
-
EXAMPLES
-
ERROR_INVALID_FEATURE
-
ERROR_INVALID_STRUCTURE
-
ERROR_INVALID_TEMPLATE_POOL
-
ERROR_INVALID_RECIPE
-
ERROR_INVALID_ADVANCEMENT
-
ERROR_NO_RECIPES_ON_CLIENT
-
registryKey
-
-
Constructor Details
-
ResourceKeyArgument
-
-
Method Details
-
key
-
getRegistryKey
public static <T> ResourceKey<T> getRegistryKey(CommandContext<CommandSourceStack> context, String name, ResourceKey<Registry<T>> registryKey, DynamicCommandExceptionType exceptionType) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
getRegistry
private static <T> Registry<T> getRegistry(CommandContext<CommandSourceStack> context, ResourceKey<? extends Registry<T>> registryKey) -
resolveKey
private static <T> Holder.Reference<T> resolveKey(CommandContext<CommandSourceStack> context, String name, ResourceKey<Registry<T>> registryKey, DynamicCommandExceptionType exception) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
getConfiguredFeature
public static Holder.Reference<ConfiguredFeature<?,?>> getConfiguredFeature(CommandContext<CommandSourceStack> context, String name) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
getStructure
public static Holder.Reference<Structure> getStructure(CommandContext<CommandSourceStack> context, String name) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
getStructureTemplatePool
public static Holder.Reference<StructureTemplatePool> getStructureTemplatePool(CommandContext<CommandSourceStack> context, String name) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
getRecipe
public static RecipeHolder<?> getRecipe(CommandContext<CommandSourceStack> context, String name) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
getAdvancement
public static AdvancementHolder getAdvancement(CommandContext<CommandSourceStack> context, String name) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
parse
- Specified by:
parsein interfaceArgumentType<T>- Throws:
CommandSyntaxException
-
listSuggestions
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) - Specified by:
listSuggestionsin interfaceArgumentType<T>
-
getExamples
- Specified by:
getExamplesin interfaceArgumentType<T>
-