Package revxrsal.commands.brigadier
Interface LampBrigadier
public interface LampBrigadier
Represents a convenient way to hook into Brigadier and respect
minor differences in different implementations
-
Method Summary
Modifier and TypeMethodDescription@NotNull ClassMap<com.mojang.brigadier.arguments.ArgumentType<?>>
Returns the special argument types for parameter types.default @Nullable com.mojang.brigadier.arguments.ArgumentType<?>
getArgumentType
(@NotNull CommandParameter parameter) Returns theArgumentType
corresponding to this parameter.default void
register
(@NotNull com.mojang.brigadier.builder.LiteralArgumentBuilder<?> node) Registers the given command node builder to the dispatchervoid
register
(@NotNull com.mojang.brigadier.tree.LiteralCommandNode<?> node) Registers the given command node to the dispatcher.@NotNull CommandActor
wrapSource
(@NotNull Object commandSource) Wraps Brigadier's command sender with the platform's appropriateCommandActor
-
Method Details
-
wrapSource
Wraps Brigadier's command sender with the platform's appropriateCommandActor
- Parameters:
commandSource
- Source to wrap- Returns:
- The wrapped command source
-
register
void register(@NotNull @NotNull com.mojang.brigadier.tree.LiteralCommandNode<?> node) Registers the given command node to the dispatcher.- Parameters:
node
- Node to register
-
getArgumentType
@Nullable default @Nullable com.mojang.brigadier.arguments.ArgumentType<?> getArgumentType(@NotNull @NotNull CommandParameter parameter) Returns theArgumentType
corresponding to this parameter. This may be used to return certain argument types that cannot be registered ingetAdditionalArgumentTypes()
(for example, generic types).- Parameters:
parameter
- Parameter to get for- Returns:
- The argument type, or
null
if not applicable.
-
getAdditionalArgumentTypes
@NotNull @NotNull ClassMap<com.mojang.brigadier.arguments.ArgumentType<?>> getAdditionalArgumentTypes()Returns the special argument types for parameter types.- Returns:
- Additional argument types
-
register
default void register(@NotNull @NotNull com.mojang.brigadier.builder.LiteralArgumentBuilder<?> node) Registers the given command node builder to the dispatcher- Parameters:
node
- Node to register
-