Interface BrigadierManager<S extends dev.velix.imperat.context.Source>

Type Parameters:
S - the command-source type
All Known Implementing Classes:
BaseBrigadierManager

public sealed interface BrigadierManager<S extends dev.velix.imperat.context.Source> permits BaseBrigadierManager<S>
A class that manages parsing Command into brigadier BrigadierNode
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull com.mojang.brigadier.arguments.ArgumentType<?>
    getArgumentType(dev.velix.imperat.command.parameters.CommandParameter<S> parameter)
    Fetches the argument type from the parameter
    <CN extends com.mojang.brigadier.tree.CommandNode<?>>
    CN
    parseCommandIntoNode(dev.velix.imperat.command.Command<S> command)
    Parses the registered Command to brigadier node
    void
    Registers the argument type resolver
    <T> void
    registerArgumentResolver(Class<T> type, ArgumentTypeResolver argumentTypeResolver)
    Registers the argument type to its class type
    wrapCommandSource(Object commandSource)
    Converts the original command source from brigadier into the platform's command-source
  • Method Details

    • wrapCommandSource

      S wrapCommandSource(Object commandSource)
      Converts the original command source from brigadier into the platform's command-source
      Parameters:
      commandSource - the command source
      Returns:
      the platform's command sender/source
    • registerArgumentResolver

      <T> void registerArgumentResolver(Class<T> type, ArgumentTypeResolver argumentTypeResolver)
      Registers the argument type to its class type
      Type Parameters:
      T - the type parameter for the type.
      Parameters:
      type - the type to register to the value-type obj
      argumentTypeResolver - the value type resolver
    • registerArgumentResolver

      void registerArgumentResolver(ArgumentTypeResolver argumentTypeResolver)
      Registers the argument type resolver
      Parameters:
      argumentTypeResolver - the value type resolver
    • getArgumentType

      @NotNull @NotNull com.mojang.brigadier.arguments.ArgumentType<?> getArgumentType(dev.velix.imperat.command.parameters.CommandParameter<S> parameter)
      Fetches the argument type from the parameter
      Parameters:
      parameter - the parameter
      Returns:
      the ArgumentType for the CommandParameter
    • parseCommandIntoNode

      <CN extends com.mojang.brigadier.tree.CommandNode<?>> CN parseCommandIntoNode(dev.velix.imperat.command.Command<S> command)
      Parses the registered Command to brigadier node
      Returns:
      the parsed node