Class MindustryCommandManager<C>

java.lang.Object
org.incendo.cloud.CommandManager<C>
com.xpdustry.distributor.api.command.cloud.MindustryCommandManager<C>
Type Parameters:
C - the command sender type
All Implemented Interfaces:
com.xpdustry.distributor.api.plugin.PluginAware, org.incendo.cloud.CommandBuilderSource<C>, org.incendo.cloud.SenderMapperHolder<com.xpdustry.distributor.api.command.CommandSender,C>, org.incendo.cloud.state.Stateful<org.incendo.cloud.state.RegistrationState>

public class MindustryCommandManager<C> extends org.incendo.cloud.CommandManager<C> implements com.xpdustry.distributor.api.plugin.PluginAware, org.incendo.cloud.SenderMapperHolder<com.xpdustry.distributor.api.command.CommandSender,C>
A command manager for Mindustry plugins.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MindustryCommandManager(com.xpdustry.distributor.api.plugin.MindustryPlugin plugin, org.incendo.cloud.execution.ExecutionCoordinator<C> coordinator, org.incendo.cloud.SenderMapper<com.xpdustry.distributor.api.command.CommandSender,C> senderMapper)
    Constructs a new MindustryCommandManager.
  • Method Summary

    Modifier and Type
    Method
    Description
    final com.xpdustry.distributor.api.command.DescriptionMapper<org.incendo.cloud.description.Description>
    Returns the DescriptionMapper of this command manager.
    final void
    descriptionMapper(com.xpdustry.distributor.api.command.DescriptionMapper<org.incendo.cloud.description.Description> descriptionMapper)
    Sets the DescriptionMapper of this command manager.
    final com.xpdustry.distributor.api.plugin.MindustryPlugin
     
    boolean
    hasPermission(@NonNull C sender, String permission)
     
    final void
    initialize(arc.util.CommandHandler handler)
    Initializes the command manager with it's backing command handler.
    protected void
    Registers the default exception handlers for this command manager.
    final @NonNull org.incendo.cloud.SenderMapper<com.xpdustry.distributor.api.command.CommandSender,C>
     

    Methods inherited from class org.incendo.cloud.CommandManager

    appendSuggestionMapper, capabilities, captionFormatter, captionFormatter, captionRegistry, captionRegistry, command, command, command, commandExecutor, commandRegistrationHandler, commandRegistrationHandler, commands, commandSyntaxFormatter, commandSyntaxFormatter, commandTree, componentBuilder, createDefaultCommandMeta, createHelpHandler, createHelpHandler, decorateBuilder, deleteRootCommand, exceptionController, flagBuilder, hasCapability, helpHandlerFactory, helpHandlerFactory, isCommandRegistrationAllowed, lockRegistration, parameterInjectorRegistry, parserRegistry, postprocessContext, preprocessContext, registerCapability, registerCommandPostProcessor, registerCommandPreProcessor, registerDefaultExceptionHandlers, rootCommands, settings, state, suggestionFactory, suggestionMapper, suggestionMapper, suggestionProcessor, suggestionProcessor, testPermission, transitionIfPossible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.incendo.cloud.CommandBuilderSource

    commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder

    Methods inherited from interface org.incendo.cloud.state.Stateful

    requireState, transitionOrThrow
  • Constructor Details

    • MindustryCommandManager

      public MindustryCommandManager(com.xpdustry.distributor.api.plugin.MindustryPlugin plugin, org.incendo.cloud.execution.ExecutionCoordinator<C> coordinator, org.incendo.cloud.SenderMapper<com.xpdustry.distributor.api.command.CommandSender,C> senderMapper)
      Constructs a new MindustryCommandManager.
      Parameters:
      plugin - the owning plugin
      coordinator - the execution coordinator
      senderMapper - the sender mapper
      See Also:
      • CommandManager(ExecutionCoordinator, CommandRegistrationHandler)
  • Method Details

    • initialize

      public final void initialize(arc.util.CommandHandler handler)
      Initializes the command manager with it's backing command handler.
      Parameters:
      handler - the backing command handler
    • descriptionMapper

      public final com.xpdustry.distributor.api.command.DescriptionMapper<org.incendo.cloud.description.Description> descriptionMapper()
      Returns the DescriptionMapper of this command manager.
    • descriptionMapper

      public final void descriptionMapper(com.xpdustry.distributor.api.command.DescriptionMapper<org.incendo.cloud.description.Description> descriptionMapper)
      Sets the DescriptionMapper of this command manager.
      Parameters:
      descriptionMapper - the new description mapper
    • hasPermission

      public boolean hasPermission(@NonNull C sender, String permission)
      Specified by:
      hasPermission in class org.incendo.cloud.CommandManager<C>
    • getPlugin

      public final com.xpdustry.distributor.api.plugin.MindustryPlugin getPlugin()
      Specified by:
      getPlugin in interface com.xpdustry.distributor.api.plugin.PluginAware
    • senderMapper

      public final @NonNull org.incendo.cloud.SenderMapper<com.xpdustry.distributor.api.command.CommandSender,C> senderMapper()
      Specified by:
      senderMapper in interface org.incendo.cloud.SenderMapperHolder<com.xpdustry.distributor.api.command.CommandSender,C>
    • registerDefaultExceptionHandlers

      protected void registerDefaultExceptionHandlers()
      Registers the default exception handlers for this command manager.