Package studio.mevera.imperat
Interface Imperat<S extends Source>
- Type Parameters:
S- the command sender valueType
- All Superinterfaces:
AnnotationInjector<S>,CommandRegistrar<S>,SourceWrapper<S>
- All Known Implementing Classes:
BaseImperat
@AvailableSince("1.0.0")
public non-sealed interface Imperat<S extends Source>
extends AnnotationInjector<S>, CommandRegistrar<S>, SourceWrapper<S>
Represents the class that handles all
commands' registrations and executions
It also caches the settings that the user can
change or modify in the api.
-
Method Summary
Modifier and TypeMethodDescriptionautoComplete(S sender, @NotNull String fullCommandLine) @NotNull ImperatConfig<S>config()The config for imperatvoiddebug(boolean treeVisualizing) Debugs all registered commands and their usages.@NotNull ExecutionResult<S>Dispatches and executes a command usingContextonly@NotNull ExecutionResult<S>Dispatches the full command-line@NotNull ExecutionResult<S>Dispatches and executes a command with certain raw arguments@NotNull ExecutionResult<S>Dispatches and executes a command with certain raw arguments@NotNull ExecutionResult<S>execute(S source, @NotNull Command<S> command, @NotNull String commandName, @NotNull String... rawInput) Dispatches and executes a command with certain raw arguments usingCommandvoidShuts down the platformMethods inherited from interface studio.mevera.imperat.AnnotationInjector
getAnnotationParser, registerAnnotationReplacer, registerAnnotations, registerThrowableHandler, setAnnotationParserMethods inherited from interface studio.mevera.imperat.CommandRegistrar
getCommand, getCommand, getRegisteredCommands, getSubCommand, registerCommand, registerCommand, registerCommand, registerCommands, registerCommands, registerCommands, unregisterAllCommands, unregisterCommandMethods inherited from interface studio.mevera.imperat.SourceWrapper
canBeSender, wrapSender
-
Method Details
-
getPlatform
Object getPlatform()- Returns:
- the platform of the module
-
shutdownPlatform
void shutdownPlatform()Shuts down the platform -
config
The config for imperat- Returns:
- the config holding all variables.
-
execute
Dispatches and executes a command usingContextonly- Parameters:
context- the context- Returns:
- the usage match setResult
- Throws:
Throwable
-
execute
@NotNull @NotNull ExecutionResult<S> execute(@NotNull S source, @NotNull @NotNull Command<S> command, @NotNull @NotNull String commandName, @NotNull @NotNull String... rawInput) Dispatches and executes a command with certain raw arguments usingCommand- Parameters:
source- the sender/executor of this commandcommand- the command object to executerawInput- the command's args input- Returns:
- the usage match setResult
-
execute
@NotNull @NotNull ExecutionResult<S> execute(@NotNull S sender, @NotNull @NotNull String commandName, @NotNull @NotNull String[] rawInput) Dispatches and executes a command with certain raw arguments- Parameters:
sender- the sender/executor of this commandcommandName- the name of the command to executerawInput- the command's args input- Returns:
- the usage match setResult
-
execute
@NotNull @NotNull ExecutionResult<S> execute(@NotNull S sender, @NotNull @NotNull String commandName, @NotNull @NotNull String rawArgsOneLine) Dispatches and executes a command with certain raw arguments- Parameters:
sender- the sender/executor of this commandcommandName- the name of the command to executerawArgsOneLine- the command's args input on ONE LINE- Returns:
- the usage match setResult
-
execute
@NotNull @NotNull ExecutionResult<S> execute(@NotNull S sender, @NotNull @NotNull String commandLine) Dispatches the full command-line- Parameters:
sender- the source/sender of the commandcommandLine- the command line to dispatch- Returns:
- the usage match setResult
-
autoComplete
CompletableFuture<List<String>> autoComplete(@NotNull S sender, @NotNull @NotNull String fullCommandLine) - Parameters:
sender- the sender writing the commandfullCommandLine- the full command line- Returns:
- the suggestions at the current position
-
debug
void debug(boolean treeVisualizing) Debugs all registered commands and their usages.- Parameters:
treeVisualizing- whether to display them in the form of tree
-