Class ContextualArgumentTypeProvider<V>

java.lang.Object
org.incendo.cloud.minecraft.modded.internal.ContextualArgumentTypeProvider<V>
All Implemented Interfaces:
Supplier<com.mojang.brigadier.arguments.ArgumentType<V>>

@API(status=INTERNAL, consumers="org.incendo.cloud.*") public final class ContextualArgumentTypeProvider<V> extends Object implements Supplier<com.mojang.brigadier.arguments.ArgumentType<V>>
  • Constructor Details

    • ContextualArgumentTypeProvider

      public ContextualArgumentTypeProvider(@NonNull Function<net.minecraft.commands.CommandBuildContext, com.mojang.brigadier.arguments.ArgumentType<V>> provider)
      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 use
      ctx - the context
      resetExisting - whether to clear cached state from existing provider instances for this command type
      action - an action to perform while the context is exposed
    • get

      public com.mojang.brigadier.arguments.ArgumentType<V> get()
      Specified by:
      get in interface Supplier<V>