Package net.minecraft.commands.arguments
Class ResourceOrIdArgument<T>
java.lang.Object
net.minecraft.commands.arguments.ResourceOrIdArgument<T>
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<Holder<T>>
- Direct Known Subclasses:
ResourceOrIdArgument.LootModifierArgument
,ResourceOrIdArgument.LootPredicateArgument
,ResourceOrIdArgument.LootTableArgument
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.brigadier.exceptions.DynamicCommandExceptionType
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
private static final Collection
<String> private final boolean
private final HolderLookup.Provider
-
Constructor Summary
ModifierConstructorDescriptionprotected
ResourceOrIdArgument
(CommandBuildContext p_334973_, ResourceKey<Registry<T>> p_336087_, com.mojang.serialization.Codec<Holder<T>> p_332112_) -
Method Summary
Modifier and TypeMethodDescriptionstatic Holder
<LootItemFunction> getLootModifier
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_334458_, String p_330525_) static Holder
<LootItemCondition> getLootPredicate
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_335366_, String p_334649_) getLootTable
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_335148_, String p_329251_) private static <T> Holder
<T> getResource
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_328476_, String p_329877_) private static boolean
hasConsumedWholeArg
(com.mojang.brigadier.StringReader p_330624_) lootModifier
(CommandBuildContext p_329720_) lootPredicate
(CommandBuildContext p_330159_) lootTable
(CommandBuildContext p_329328_) parse
(com.mojang.brigadier.StringReader p_330381_) (package private) static Tag
parseInlineOrId
(com.mojang.brigadier.StringReader p_331361_) 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
listSuggestions
-
Field Details
-
EXAMPLES
-
ERROR_FAILED_TO_PARSE
public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_FAILED_TO_PARSE -
ERROR_INVALID
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_INVALID -
registryLookup
-
hasRegistry
private final boolean hasRegistry -
codec
-
-
Constructor Details
-
ResourceOrIdArgument
protected ResourceOrIdArgument(CommandBuildContext p_334973_, ResourceKey<Registry<T>> p_336087_, com.mojang.serialization.Codec<Holder<T>> p_332112_)
-
-
Method Details
-
lootTable
-
getLootTable
public static Holder<LootTable> getLootTable(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_335148_, String p_329251_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
lootModifier
-
getLootModifier
public static Holder<LootItemFunction> getLootModifier(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_334458_, String p_330525_) -
lootPredicate
public static ResourceOrIdArgument.LootPredicateArgument lootPredicate(CommandBuildContext p_330159_) -
getLootPredicate
public static Holder<LootItemCondition> getLootPredicate(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_335366_, String p_334649_) -
getResource
private static <T> Holder<T> getResource(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_328476_, String p_329877_) -
parse
@Nullable public Holder<T> parse(com.mojang.brigadier.StringReader p_330381_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parse
in interfacecom.mojang.brigadier.arguments.ArgumentType<T>
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parseInlineOrId
static Tag parseInlineOrId(com.mojang.brigadier.StringReader p_331361_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
hasConsumedWholeArg
private static boolean hasConsumedWholeArg(com.mojang.brigadier.StringReader p_330624_) -
getExamples
- Specified by:
getExamples
in interfacecom.mojang.brigadier.arguments.ArgumentType<T>
-