Class VelocityCommandManager<C>

java.lang.Object
cloud.commandframework.CommandManager<C>
cloud.commandframework.velocity.VelocityCommandManager<C>
Type Parameters:
C - Command sender type
All Implemented Interfaces:
cloud.commandframework.brigadier.BrigadierManagerHolder<C>

public class VelocityCommandManager<C> extends cloud.commandframework.CommandManager<C> implements cloud.commandframework.brigadier.BrigadierManagerHolder<C>
CommandManager implementation for Velocity.

This can be injected if CloudInjectionModule is registered in the injector. This can be achieved by using Injector.createChildInjector(Module...)

  • Nested Class Summary

    Nested classes/interfaces inherited from class cloud.commandframework.CommandManager

    cloud.commandframework.CommandManager.ManagerSettings, cloud.commandframework.CommandManager.RegistrationState
  • Field Summary

    Fields
  • Constructor Summary

    Constructors
    Constructor
    Description
    VelocityCommandManager(@NonNull com.velocitypowered.api.proxy.ProxyServer proxyServer, @NonNull Function<@NonNull cloud.commandframework.CommandTree<C>,@NonNull cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull Function<@NonNull com.velocitypowered.api.command.CommandSource,@NonNull C> commandSenderMapper, @NonNull Function<@NonNull C,@NonNull com.velocitypowered.api.command.CommandSource> backwardsCommandSenderMapper)
    Deprecated.
    VelocityCommandManager(@Nullable com.velocitypowered.api.plugin.PluginContainer plugin, @NonNull com.velocitypowered.api.proxy.ProxyServer proxyServer, @NonNull Function<@NonNull cloud.commandframework.CommandTree<C>,@NonNull cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull Function<@NonNull com.velocitypowered.api.command.CommandSource,@NonNull C> commandSenderMapper, @NonNull Function<@NonNull C,@NonNull com.velocitypowered.api.command.CommandSource> backwardsCommandSenderMapper)
    Create a new command manager instance
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull cloud.commandframework.brigadier.CloudBrigadierManager<C,com.velocitypowered.api.command.CommandSource>
    final @NonNull cloud.commandframework.meta.CommandMeta
     
    final boolean
    hasPermission(@NonNull C sender, @NonNull String permission)
     

    Methods inherited from class cloud.commandframework.CommandManager

    argumentBuilder, capabilities, captionRegistry, captionRegistry, captionVariableReplacementHandler, captionVariableReplacementHandler, command, command, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandExecutionCoordinator, commandRegistrationHandler, commandRegistrationHandler, commands, commandSuggestionProcessor, commandSuggestionProcessor, commandSyntaxFormatter, commandSyntaxFormatter, commandTree, createCommandHelpHandler, createCommandHelpHandler, deleteRootCommand, executeCommand, flagBuilder, getCaptionRegistry, getCommandHelpHandler, getCommandHelpHandler, getCommandRegistrationHandler, getCommands, getCommandSuggestionProcessor, getCommandSyntaxFormatter, getCommandTree, getExceptionHandler, getParserRegistry, getRegistrationState, getSetting, handleException, hasCapability, hasPermission, isCommandRegistrationAllowed, lockRegistration, parameterInjectorRegistry, parserRegistry, postprocessContext, preprocessContext, registerCapability, registerCommandPostProcessor, registerCommandPreProcessor, registerDefaultCaptions, registerExceptionHandler, registrationState, requireState, rootCommands, setCaptionRegistry, setCommandRegistrationHandler, setCommandSuggestionProcessor, setCommandSyntaxFormatter, setSetting, suggest, transitionIfPossible, transitionOrThrow

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • VelocityCommandManager

      @Deprecated public VelocityCommandManager(@NonNull com.velocitypowered.api.proxy.ProxyServer proxyServer, @NonNull Function<@NonNull cloud.commandframework.CommandTree<C>,@NonNull cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull Function<@NonNull com.velocitypowered.api.command.CommandSource,@NonNull C> commandSenderMapper, @NonNull Function<@NonNull C,@NonNull com.velocitypowered.api.command.CommandSource> backwardsCommandSenderMapper)
      Deprecated.
      Create a new command manager instance.
      Parameters:
      proxyServer - ProxyServer instance
      commandExecutionCoordinator - Coordinator provider
      commandSenderMapper - Function that maps CommandSource to the command sender type
      backwardsCommandSenderMapper - Function that maps the command sender type to CommandSource
    • VelocityCommandManager

      @Inject public VelocityCommandManager(@Nullable com.velocitypowered.api.plugin.PluginContainer plugin, @NonNull com.velocitypowered.api.proxy.ProxyServer proxyServer, @NonNull Function<@NonNull cloud.commandframework.CommandTree<C>,@NonNull cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull Function<@NonNull com.velocitypowered.api.command.CommandSource,@NonNull C> commandSenderMapper, @NonNull Function<@NonNull C,@NonNull com.velocitypowered.api.command.CommandSource> backwardsCommandSenderMapper)
      Create a new command manager instance
      Parameters:
      plugin - Container for the owning plugin. Nullable for backwards compatibility
      proxyServer - ProxyServer instance
      commandExecutionCoordinator - Coordinator provider
      commandSenderMapper - Function that maps CommandSource to the command sender type
      backwardsCommandSenderMapper - Function that maps the command sender type to CommandSource
  • Method Details

    • hasPermission

      public final boolean hasPermission(@NonNull C sender, @NonNull String permission)
      Specified by:
      hasPermission in class cloud.commandframework.CommandManager<C>
    • createDefaultCommandMeta

      public final @NonNull cloud.commandframework.meta.CommandMeta createDefaultCommandMeta()
      Specified by:
      createDefaultCommandMeta in class cloud.commandframework.CommandManager<C>
    • brigadierManager

      public @NonNull cloud.commandframework.brigadier.CloudBrigadierManager<C,com.velocitypowered.api.command.CommandSource> brigadierManager()

      In the case of the VelocityCommandManager, Brigadier is always used for command registration, and therefore this method will never return null.

      Specified by:
      brigadierManager in interface cloud.commandframework.brigadier.BrigadierManagerHolder<C>
      Since:
      1.2.0