Class ResourceSelectorArgument<T>
java.lang.Object
net.minecraft.commands.arguments.ResourceSelectorArgument<T>
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<Collection<Holder.Reference<T>>>
public class ResourceSelectorArgument<T>
extends Object
implements com.mojang.brigadier.arguments.ArgumentType<Collection<Holder.Reference<T>>>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionTypeprivate static final Collection<String> private final ResourceKey<? extends Registry<T>> private final HolderLookup<T> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateResourceSelectorArgument(CommandBuildContext context, ResourceKey<? extends Registry<T>> registryKey) -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringensureNamespaced(String input) static <T> Collection<Holder.Reference<T>> getSelectedResources(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, String name) private static booleanisAllowedPatternCharacter(char character) <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) private static booleanmatches(String pattern, Identifier key) parse(com.mojang.brigadier.StringReader reader) static <T> Collection<Holder.Reference<T>> parse(com.mojang.brigadier.StringReader reader, HolderLookup<T> registry) private static StringreadPattern(com.mojang.brigadier.StringReader reader) static <T> ResourceSelectorArgument<T> resourceSelector(CommandBuildContext context, ResourceKey<? extends Registry<T>> registry) 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_NO_MATCHES
public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_NO_MATCHES -
registryKey
-
registryLookup
-
-
Constructor Details
-
ResourceSelectorArgument
private ResourceSelectorArgument(CommandBuildContext context, ResourceKey<? extends Registry<T>> registryKey)
-
-
Method Details
-
parse
public Collection<Holder.Reference<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
-
parse
public static <T> Collection<Holder.Reference<T>> parse(com.mojang.brigadier.StringReader reader, HolderLookup<T> registry) -
readPattern
-
isAllowedPatternCharacter
private static boolean isAllowedPatternCharacter(char character) -
ensureNamespaced
-
matches
-
resourceSelector
public static <T> ResourceSelectorArgument<T> resourceSelector(CommandBuildContext context, ResourceKey<? extends Registry<T>> registry) -
getSelectedResources
public static <T> Collection<Holder.Reference<T>> getSelectedResources(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, String name) -
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>
-