Package net.minecraft.commands.arguments
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.Dynamic2CommandExceptionType
private static final Collection
<String> (package private) final ResourceKey
<? extends Registry<T>> private final HolderLookup
<T> -
Constructor Summary
ConstructorsConstructorDescriptionResourceSelectorArgument
(CommandBuildContext p_397758_, ResourceKey<? extends Registry<T>> p_397841_) -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
ensureNamespaced
(String p_397692_) static <T> Collection
<Holder.Reference<T>> getSelectedResources
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_397945_, String p_397186_, ResourceKey<? extends Registry<T>> p_397192_) private static boolean
isAllowedPatternCharacter
(char p_397389_) <S> CompletableFuture
<com.mojang.brigadier.suggestion.Suggestions> listSuggestions
(com.mojang.brigadier.context.CommandContext<S> p_397613_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_397790_) private static boolean
matches
(String p_397067_, ResourceLocation p_397052_) parse
(com.mojang.brigadier.StringReader p_397392_) static <T> Collection
<Holder.Reference<T>> parse
(com.mojang.brigadier.StringReader p_397046_, HolderLookup<T> p_397718_) private static String
readPattern
(com.mojang.brigadier.StringReader p_397824_) static <T> ResourceSelectorArgument
<T> resourceSelector
(CommandBuildContext p_397004_, ResourceKey<? extends Registry<T>> p_397925_) 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_NO_MATCHES
public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_NO_MATCHES -
registryKey
-
registryLookup
-
-
Constructor Details
-
ResourceSelectorArgument
ResourceSelectorArgument(CommandBuildContext p_397758_, ResourceKey<? extends Registry<T>> p_397841_)
-
-
Method Details
-
parse
public Collection<Holder.Reference<T>> parse(com.mojang.brigadier.StringReader p_397392_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parse
in 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 p_397046_, HolderLookup<T> p_397718_) -
readPattern
-
isAllowedPatternCharacter
private static boolean isAllowedPatternCharacter(char p_397389_) -
ensureNamespaced
-
matches
-
resourceSelector
public static <T> ResourceSelectorArgument<T> resourceSelector(CommandBuildContext p_397004_, ResourceKey<? extends Registry<T>> p_397925_) -
getSelectedResources
public static <T> Collection<Holder.Reference<T>> getSelectedResources(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_397945_, String p_397186_, ResourceKey<? extends Registry<T>> p_397192_) -
listSuggestions
public <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> p_397613_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_397790_) - Specified by:
listSuggestions
in interfacecom.mojang.brigadier.arguments.ArgumentType<T>
-
getExamples
- Specified by:
getExamples
in interfacecom.mojang.brigadier.arguments.ArgumentType<T>
-