Package dev.velix.imperat
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 TypeMethodDescription@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<?>>
CNparseCommandIntoNode(dev.velix.imperat.command.Command<S> command) Parses the registeredCommandto brigadier nodevoidregisterArgumentResolver(ArgumentTypeResolver argumentTypeResolver) Registers the argument type resolver<T> voidregisterArgumentResolver(Class<T> type, ArgumentTypeResolver argumentTypeResolver) Registers the argument type to its class typewrapCommandSource(Object commandSource) Converts the original command source from brigadier into the platform's command-source
-
Method Details
-
wrapCommandSource
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
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 objargumentTypeResolver- the value type resolver
-
registerArgumentResolver
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
ArgumentTypefor theCommandParameter
-
parseCommandIntoNode
<CN extends com.mojang.brigadier.tree.CommandNode<?>> CN parseCommandIntoNode(dev.velix.imperat.command.Command<S> command) Parses the registeredCommandto brigadier node- Returns:
- the parsed node
-