@FunctionalInterface
public interface ArgumentTypeFactory<A extends revxrsal.commands.command.CommandActor>
ArgumentTypes for parameters. This
can read annotations and other information to construct a suitable argument
type.
Register with ArgumentTypes.Builder.addTypeFactory(ArgumentTypeFactory).
| Modifier and Type | Method and Description |
|---|---|
static <A extends revxrsal.commands.command.CommandActor> |
forType(java.lang.Class<?> type,
com.mojang.brigadier.arguments.ArgumentType<?> argumentType)
Creates a
ArgumentTypeFactory that will return the same
argument type for all parameters that match a specific type |
static <A extends revxrsal.commands.command.CommandActor> |
forTypeAndSubclasses(java.lang.Class<?> type,
com.mojang.brigadier.arguments.ArgumentType<?> argumentType)
Creates a
ArgumentTypeFactory that will return the same
argument type for all parameters that match a specific type and
all of its subclasses. |
@Nullable com.mojang.brigadier.arguments.ArgumentType<?> |
getArgumentType(@NotNull revxrsal.commands.node.ParameterNode<A,?> parameter)
Returns the argument type for the given parameter.
|
@NotNull static <A extends revxrsal.commands.command.CommandActor> @NotNull ArgumentTypeFactory<A> forType(java.lang.Class<?> type, com.mojang.brigadier.arguments.ArgumentType<?> argumentType)
ArgumentTypeFactory that will return the same
argument type for all parameters that match a specific typetype - Type to check forargumentType - The argument type to return@NotNull static <A extends revxrsal.commands.command.CommandActor> @NotNull ArgumentTypeFactory<A> forTypeAndSubclasses(java.lang.Class<?> type, com.mojang.brigadier.arguments.ArgumentType<?> argumentType)
ArgumentTypeFactory that will return the same
argument type for all parameters that match a specific type and
all of its subclasses.type - Type to check forargumentType - The argument type to return@Nullable
@Nullable com.mojang.brigadier.arguments.ArgumentType<?> getArgumentType(@NotNull
@NotNull revxrsal.commands.node.ParameterNode<A,?> parameter)
parameter - Parameter to create for