Package studio.mevera.imperat
Interface Imperat<S extends CommandSource>
- Type Parameters:
S- the command sender valueType
- All Superinterfaces:
AnnotationInjector<S>,CommandRegistrar<S>,EventListener,EventPublisher,SourceWrapper<S>
- All Known Implementing Classes:
BaseImperat
@AvailableSince("1.0.0")
public non-sealed interface Imperat<S extends CommandSource>
extends AnnotationInjector<S>, CommandRegistrar<S>, SourceWrapper<S>, EventListener, EventPublisher
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()Debugs all registered commands and their usages.@NotNull ExecutionResult<S>execute(@NotNull CommandContext<S> context) Dispatches and executes a command usingCommandContextonly@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, registerGlobalExceptionHandlers, setAnnotationParserMethods inherited from interface studio.mevera.imperat.CommandRegistrar
getCommand, getCommand, getRegisteredCommands, getSubCommand, registerCommand, registerCommand, registerCommands, registerCommands, registerCommands, registerSimpleCommand, unregisterAllCommands, unregisterCommandMethods inherited from interface studio.mevera.imperat.events.EventListener
listen, listen, listen, removeListenerMethods inherited from interface studio.mevera.imperat.events.EventPublisher
publishEventMethods inherited from interface studio.mevera.imperat.SourceWrapper
canBeSender, createDummySender, 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
@NotNull @NotNull ExecutionResult<S> execute(@NotNull @NotNull CommandContext<S> context) throws Throwable Dispatches and executes a command usingCommandContextonly- 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()Debugs all registered commands and their usages.
-