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