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_335864_, ResourceKey<Registry<T>> p_335475_, com.mojang.serialization.Codec<Holder<T>> p_335632_) -
Method Summary
Modifier and TypeMethodDescriptionstatic Holder
<LootItemFunction> getLootModifier
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_335678_, String p_336178_) static Holder
<LootItemCondition> getLootPredicate
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_336183_, String p_336098_) getLootTable
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_335373_, String p_336017_) private static <T> Holder
<T> getResource
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_336122_, String p_335417_) private static boolean
hasConsumedWholeArg
(com.mojang.brigadier.StringReader p_335624_) lootModifier
(CommandBuildContext p_335731_) lootPredicate
(CommandBuildContext p_335891_) lootTable
(CommandBuildContext p_335938_) parse
(com.mojang.brigadier.StringReader p_335906_) (package private) static Tag
parseInlineOrId
(com.mojang.brigadier.StringReader p_335947_) 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_335864_, ResourceKey<Registry<T>> p_335475_, com.mojang.serialization.Codec<Holder<T>> p_335632_)
-
-
Method Details
-
lootTable
-
getLootTable
public static Holder<LootTable> getLootTable(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_335373_, String p_336017_) 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_335678_, String p_336178_) -
lootPredicate
public static ResourceOrIdArgument.LootPredicateArgument lootPredicate(CommandBuildContext p_335891_) -
getLootPredicate
public static Holder<LootItemCondition> getLootPredicate(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_336183_, String p_336098_) -
getResource
private static <T> Holder<T> getResource(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_336122_, String p_335417_) -
parse
@Nullable public Holder<T> parse(com.mojang.brigadier.StringReader p_335906_) 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_335947_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
hasConsumedWholeArg
private static boolean hasConsumedWholeArg(com.mojang.brigadier.StringReader p_335624_) -
getExamples
- Specified by:
getExamples
in interfacecom.mojang.brigadier.arguments.ArgumentType<T>
-