Package net.minecraft.commands.arguments
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.DynamicCommandExceptionType
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType
private static final Collection
<String> (package private) final ResourceKey
<? extends Registry<T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Holder.Reference
<ConfiguredFeature<?, ?>> getConfiguredFeature
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) private static <T> Registry
<T> getRegistry
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, ResourceKey<? extends Registry<T>> pRegistryKey) private static <T> ResourceKey
<T> getRegistryKey
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument, ResourceKey<Registry<T>> pRegistryKey, com.mojang.brigadier.exceptions.DynamicCommandExceptionType pException) static Holder.Reference
<Structure> getStructure
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) getStructureTemplatePool
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) static <T> ResourceKeyArgument
<T> key
(ResourceKey<? extends Registry<T>> pRegistryKey) <S> CompletableFuture
<com.mojang.brigadier.suggestion.Suggestions> listSuggestions
(com.mojang.brigadier.context.CommandContext<S> pContext, com.mojang.brigadier.suggestion.SuggestionsBuilder pBuilder) parse
(com.mojang.brigadier.StringReader pReader) private static <T> Holder.Reference
<T> resolveKey
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument, ResourceKey<Registry<T>> pRegistryKey, com.mojang.brigadier.exceptions.DynamicCommandExceptionType pException) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 -
registryKey
-
-
Constructor Details
-
ResourceKeyArgument
-
-
Method Details
-
key
-
getRegistryKey
private static <T> ResourceKey<T> getRegistryKey(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument, ResourceKey<Registry<T>> pRegistryKey, com.mojang.brigadier.exceptions.DynamicCommandExceptionType pException) 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> pContext, ResourceKey<? extends Registry<T>> pRegistryKey) -
resolveKey
private static <T> Holder.Reference<T> resolveKey(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument, ResourceKey<Registry<T>> pRegistryKey, com.mojang.brigadier.exceptions.DynamicCommandExceptionType pException) 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> pContext, String pArgument) 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> pContext, String pArgument) 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> pContext, String pArgument) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parse
public ResourceKey<T> parse(com.mojang.brigadier.StringReader pReader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parse
in 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> pContext, com.mojang.brigadier.suggestion.SuggestionsBuilder pBuilder) - Specified by:
listSuggestions
in interfacecom.mojang.brigadier.arguments.ArgumentType<T>
-
getExamples
- Specified by:
getExamples
in interfacecom.mojang.brigadier.arguments.ArgumentType<T>
-