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 Details

    • getPlatform

      Object getPlatform()
      Returns:
      the platform of the module
    • shutdownPlatform

      void shutdownPlatform()
      Shuts down the platform
    • config

      @NotNull @NotNull ImperatConfig<S> config()
      The config for imperat
      Returns:
      the config holding all variables.
    • execute

      @NotNull @NotNull ExecutionResult<S> execute(@NotNull @NotNull Context<S> context) throws Throwable
      Dispatches and executes a command using Context only
      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 using Command
      Parameters:
      source - the sender/executor of this command
      command - the command object to execute
      rawInput - 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 command
      commandName - the name of the command to execute
      rawInput - 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 command
      commandName - the name of the command to execute
      rawArgsOneLine - 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 command
      commandLine - 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 command
      fullCommandLine - 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