Package cloud.commandframework.velocity
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 usingInjector.createChildInjector(Module...)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ARGUMENT_PARSE_FAILURE_PLAYER
Default caption forVelocityCaptionKeys.ARGUMENT_PARSE_FAILURE_PLAYER
static java.lang.String
ARGUMENT_PARSE_FAILURE_SERVER
Default caption forVelocityCaptionKeys.ARGUMENT_PARSE_FAILURE_SERVER
-
Constructor Summary
Constructors Constructor Description VelocityCommandManager(@NonNull com.velocitypowered.api.proxy.ProxyServer proxyServer, @NonNull java.util.function.Function<@NonNull cloud.commandframework.CommandTree<C>,@NonNull cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull java.util.function.Function<@NonNull com.velocitypowered.api.command.CommandSource,@NonNull C> commandSenderMapper, @NonNull java.util.function.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 java.util.function.Function<@NonNull cloud.commandframework.CommandTree<C>,@NonNull cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull java.util.function.Function<@NonNull com.velocitypowered.api.command.CommandSource,@NonNull C> commandSenderMapper, @NonNull java.util.function.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>
brigadierManager()
@NonNull cloud.commandframework.meta.CommandMeta
createDefaultCommandMeta()
boolean
hasPermission(@NonNull C sender, @NonNull java.lang.String permission)
-
Methods inherited from class cloud.commandframework.CommandManager
argumentBuilder, command, command, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, executeCommand, flagBuilder, getCaptionRegistry, getCommandHelpHandler, getCommandRegistrationHandler, getCommands, getCommandSuggestionProcessor, getCommandSyntaxFormatter, getCommandTree, getExceptionHandler, getParserRegistry, getRegistrationState, getSetting, handleException, hasPermission, isCommandRegistrationAllowed, postprocessContext, preprocessContext, registerCommandPostProcessor, registerCommandPreProcessor, registerDefaultCaptions, registerExceptionHandler, requireState, setCaptionRegistry, setCommandRegistrationHandler, setCommandSuggestionProcessor, setCommandSyntaxFormatter, setSetting, suggest, transitionIfPossible, transitionOrThrow
-
-
-
-
Field Detail
-
ARGUMENT_PARSE_FAILURE_PLAYER
public static final java.lang.String ARGUMENT_PARSE_FAILURE_PLAYER
Default caption forVelocityCaptionKeys.ARGUMENT_PARSE_FAILURE_PLAYER
- See Also:
- Constant Field Values
-
ARGUMENT_PARSE_FAILURE_SERVER
public static final java.lang.String ARGUMENT_PARSE_FAILURE_SERVER
Default caption forVelocityCaptionKeys.ARGUMENT_PARSE_FAILURE_SERVER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VelocityCommandManager
@Deprecated public VelocityCommandManager(@NonNull com.velocitypowered.api.proxy.ProxyServer proxyServer, @NonNull java.util.function.Function<@NonNull cloud.commandframework.CommandTree<C>,@NonNull cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull java.util.function.Function<@NonNull com.velocitypowered.api.command.CommandSource,@NonNull C> commandSenderMapper, @NonNull java.util.function.Function<@NonNull C,@NonNull com.velocitypowered.api.command.CommandSource> backwardsCommandSenderMapper)
Deprecated.Create a new command manager instance.- Parameters:
proxyServer
- ProxyServer instancecommandExecutionCoordinator
- Coordinator providercommandSenderMapper
- Function that mapsCommandSource
to the command sender typebackwardsCommandSenderMapper
- Function that maps the command sender type toCommandSource
-
VelocityCommandManager
@Inject public VelocityCommandManager(@Nullable com.velocitypowered.api.plugin.PluginContainer plugin, @NonNull com.velocitypowered.api.proxy.ProxyServer proxyServer, @NonNull java.util.function.Function<@NonNull cloud.commandframework.CommandTree<C>,@NonNull cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull java.util.function.Function<@NonNull com.velocitypowered.api.command.CommandSource,@NonNull C> commandSenderMapper, @NonNull java.util.function.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 compatibilityproxyServer
- ProxyServer instancecommandExecutionCoordinator
- Coordinator providercommandSenderMapper
- Function that mapsCommandSource
to the command sender typebackwardsCommandSenderMapper
- Function that maps the command sender type toCommandSource
-
-
Method Detail
-
hasPermission
public final boolean hasPermission(@NonNull C sender, @NonNull java.lang.String permission)
- Specified by:
hasPermission
in classcloud.commandframework.CommandManager<C>
-
createDefaultCommandMeta
public final @NonNull cloud.commandframework.meta.CommandMeta createDefaultCommandMeta()
- Specified by:
createDefaultCommandMeta
in classcloud.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 returnnull
.- Specified by:
brigadierManager
in interfacecloud.commandframework.brigadier.BrigadierManagerHolder<C>
- Since:
- 1.2.0
-
-