Package org.incendo.cloud.velocity
Class VelocityCommandManager<C>
java.lang.Object
org.incendo.cloud.CommandManager<C>
org.incendo.cloud.velocity.VelocityCommandManager<C>
- Type Parameters:
C- Command sender type
- All Implemented Interfaces:
BrigadierManagerHolder<C,,com.velocitypowered.api.command.CommandSource> CommandBuilderSource<C>,SenderMapperHolder<com.velocitypowered.api.command.CommandSource,,C> Stateful<RegistrationState>
public class VelocityCommandManager<C>
extends CommandManager<C>
implements BrigadierManagerHolder<C,com.velocitypowered.api.command.CommandSource>, SenderMapperHolder<com.velocitypowered.api.command.CommandSource,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...)
suggestionFactory() has been overridden to map suggestions to TooltipSuggestion.
You may use TooltipSuggestion to display tooltips for your suggestions.
VelocityBrigadierMessage can be used to make use of Adventure
components in the tooltips.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.incendo.cloud.brigadier.BrigadierManagerHolder
BrigadierManagerHolder.BrigadierManagerNotPresent -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault caption forVelocityCaptionKeys.ARGUMENT_PARSE_FAILURE_PLAYERstatic final StringDefault caption forVelocityCaptionKeys.ARGUMENT_PARSE_FAILURE_SERVER -
Constructor Summary
ConstructorsConstructorDescriptionVelocityCommandManager(@NonNull com.velocitypowered.api.plugin.PluginContainer plugin, @NonNull com.velocitypowered.api.proxy.ProxyServer proxyServer, @NonNull ExecutionCoordinator<C> commandExecutionCoordinator, @NonNull SenderMapper<com.velocitypowered.api.command.CommandSource, C> senderMapper) Create a new command manager instance -
Method Summary
Modifier and TypeMethodDescriptionfinal @NonNull CloudBrigadierManager<C, com.velocitypowered.api.command.CommandSource> final booleanfinal booleanhasPermission(@NonNull C sender, @NonNull String permission) final @NonNull SenderMapper<com.velocitypowered.api.command.CommandSource, C> final @NonNull SuggestionFactory<C, ? extends TooltipSuggestion> 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, suggestionMapper, suggestionMapper, suggestionProcessor, suggestionProcessor, testPermission, transitionIfPossibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.incendo.cloud.CommandBuilderSource
commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilderMethods inherited from interface org.incendo.cloud.state.Stateful
requireState, transitionOrThrow
-
Field Details
-
ARGUMENT_PARSE_FAILURE_PLAYER
Default caption forVelocityCaptionKeys.ARGUMENT_PARSE_FAILURE_PLAYER- See Also:
-
ARGUMENT_PARSE_FAILURE_SERVER
Default caption forVelocityCaptionKeys.ARGUMENT_PARSE_FAILURE_SERVER- See Also:
-
-
Constructor Details
-
VelocityCommandManager
@Inject public VelocityCommandManager(@NonNull com.velocitypowered.api.plugin.PluginContainer plugin, @NonNull com.velocitypowered.api.proxy.ProxyServer proxyServer, @NonNull ExecutionCoordinator<C> commandExecutionCoordinator, @NonNull SenderMapper<com.velocitypowered.api.command.CommandSource, C> senderMapper) Create a new command manager instance- Parameters:
plugin- Container for the owning pluginproxyServer- ProxyServer instancecommandExecutionCoordinator- Coordinator providersenderMapper- Function that mapsCommandSourceto the command sender type
-
-
Method Details
-
hasPermission
- Specified by:
hasPermissionin classCommandManager<C>
-
hasBrigadierManager
This will always return true for
VelocityCommandManagers.- Specified by:
hasBrigadierManagerin interfaceBrigadierManagerHolder<C,com.velocitypowered.api.command.CommandSource> - Returns:
true- Since:
- 2.0.0
-
brigadierManager
@API(status=STABLE, since="2.0.0") public final @NonNull CloudBrigadierManager<C,com.velocitypowered.api.command.CommandSource> brigadierManager()VelocityCommandManagers always use Brigadier for registration, so the aforementioned check is not needed.- Specified by:
brigadierManagerin interfaceBrigadierManagerHolder<C,com.velocitypowered.api.command.CommandSource> - Returns:
- Since:
- 1.2.0
-
suggestionFactory
- Overrides:
suggestionFactoryin classCommandManager<C>
-
senderMapper
- Specified by:
senderMapperin interfaceSenderMapperHolder<com.velocitypowered.api.command.CommandSource,C>
-