Class ContextualArgumentTypeProvider<V>
java.lang.Object
org.incendo.cloud.minecraft.modded.internal.ContextualArgumentTypeProvider<V>
- All Implemented Interfaces:
Supplier<com.mojang.brigadier.arguments.ArgumentType<V>>
-
Constructor Summary
ConstructorsConstructorDescriptionContextualArgumentTypeProvider(@NonNull Function<net.minecraft.commands.CommandBuildContext, com.mojang.brigadier.arguments.ArgumentType<V>> provider) Creates a newContextualArgumentTypeProvider. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.brigadier.arguments.ArgumentType<V> get()static voidwithBuildContext(CommandManager<?> commandManager, net.minecraft.commands.CommandBuildContext ctx, boolean resetExisting, Runnable action) Temporarily expose a command build context to providers called from this thread.
-
Constructor Details
-
ContextualArgumentTypeProvider
public ContextualArgumentTypeProvider(@NonNull Function<net.minecraft.commands.CommandBuildContext, com.mojang.brigadier.arguments.ArgumentType<V>> provider) Creates a newContextualArgumentTypeProvider.- Parameters:
provider- argument provider
-
-
Method Details
-
withBuildContext
public static void withBuildContext(CommandManager<?> commandManager, net.minecraft.commands.CommandBuildContext ctx, boolean resetExisting, Runnable action) Temporarily expose a command build context to providers called from this thread.- Parameters:
commandManager- command manager to usectx- the contextresetExisting- whether to clear cached state from existing provider instances for this command typeaction- an action to perform while the context is exposed
-
get
-