Interface CommandManager
- 
- All Known Subinterfaces:
- CommandManager.Mutable
 
 @DoNotStore public interface CommandManager Registers and dispatches commands.The command manager may be replaced at any point during the game lifecycle when the client chooses to reload registries. 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceCommandManager.MutableA mutable view of the command manager, allowing additional commands to be registered.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<CommandMapping>commandMapping(String alias)Gets theCommandMappingassociated with the requested alias, if any.List<CommandCompletion>complete(String arguments)Provides possible completions based on the input argument string.List<CommandCompletion>complete(Subject subject, Audience receiver, String arguments)<T extends Subject & Audience>
 List<CommandCompletion>complete(T subjectReceiver, String arguments)Set<String>knownAliases()Gets all the command aliases known to this command manager.Set<CommandMapping>knownMappings()Gets all themappingsknown to this command manager.Collection<org.spongepowered.plugin.PluginContainer>plugins()Gets aCollectionofPluginContainers with commands registered.CommandResultprocess(String arguments)Executes a command based on the provided arguments.CommandResultprocess(Subject subject, Audience channel, String arguments)<T extends Subject & Audience>
 CommandResultprocess(T subjectReceiver, String arguments)<T> Optional<CommandRegistrar<T>>registrar(io.leangen.geantyref.TypeToken<T> type)Get a registrar that will register commands oftypeto the active command manager.<T> Optional<CommandRegistrar<T>>registrar(Class<T> type)Get a registrar that will register commands oftypeto the active command manager.voidupdateCommandTreeForPlayer(ServerPlayer player)Asks the server to send an updated client completion command tree to the specifiedServerPlayer.
 
- 
- 
- 
Method Detail- 
registrar<T> Optional<CommandRegistrar<T>> registrar(Class<T> type) Get a registrar that will register commands oftypeto the active command manager.This allows for out-of-band command registrations between calls to RegisterCommandEvent, though where possible that event should be preferred.When commands are registered outside of events, changes will not be automatically reflected in client command views. To update any applicable clients, see updateCommandTreeForPlayer(ServerPlayer).- Type Parameters:
- T- registrar type
- Parameters:
- type- the registrar type
- Returns:
- a registrar, if any is known for type
 
 - 
registrar<T> Optional<CommandRegistrar<T>> registrar(io.leangen.geantyref.TypeToken<T> type) Get a registrar that will register commands oftypeto the active command manager.This allows for out-of-band command registrations between calls to RegisterCommandEvent, though where possible that event should be preferred.When commands are registered outside of events, changes will not be automatically reflected in client command views. To update any applicable clients, see updateCommandTreeForPlayer(ServerPlayer).- Type Parameters:
- T- registrar type
- Parameters:
- type- the registrar type
- Returns:
- a registrar, if any is known for type
 
 - 
processCommandResult process(String arguments) throws CommandException Executes a command based on the provided arguments.- Parameters:
- arguments- The arguments to parse and execute
- Returns:
- The CommandResult
- Throws:
- CommandException- if something goes wrong during parsing or execution
 
 - 
process<T extends Subject & Audience> CommandResult process(T subjectReceiver, String arguments) throws CommandException Executes a command based on the provided arguments, with a provided object that is both aSubjectfor permission checks and aAudienceto return command messages to.- Type Parameters:
- T- The type of receiver
- Parameters:
- subjectReceiver- The- Subject&- Audience
- arguments- The arguments to parse and execute
- Returns:
- The CommandResult
- Throws:
- CommandException- if something goes wrong during parsing or execution
 
 - 
processCommandResult process(Subject subject, Audience channel, String arguments) throws CommandException Executes a command based on the provided arguments, with a providedSubjectfor permission checks and a providedAudienceto return command messages to.- Parameters:
- subject- The- Subjectfor permission checks
- channel- The- Audienceto return messages to
- arguments- The arguments of the command
- Returns:
- The CommandResult
- Throws:
- CommandException- if something goes wrong during parsing or execution
 
 - 
completeList<CommandCompletion> complete(String arguments) Provides possible completions based on the input argument string.- Parameters:
- arguments- The arguments
- Returns:
- The completions
 
 - 
complete<T extends Subject & Audience> List<CommandCompletion> complete(T subjectReceiver, String arguments) 
 - 
completeList<CommandCompletion> complete(Subject subject, Audience receiver, String arguments) 
 - 
knownAliasesSet<String> knownAliases() Gets all the command aliases known to this command manager.- Returns:
- The known aliases
 
 - 
knownMappingsSet<CommandMapping> knownMappings() Gets all themappingsknown to this command manager.- Returns:
- The known mappings.
 
 - 
pluginsCollection<org.spongepowered.plugin.PluginContainer> plugins() Gets aCollectionofPluginContainers with commands registered.- Returns:
- A CollectionofPluginContainers.
 
 - 
commandMappingOptional<CommandMapping> commandMapping(String alias) Gets theCommandMappingassociated with the requested alias, if any.- Parameters:
- alias- The alias to get the mapping for
- Returns:
- The CommandMapping, if any
 
 - 
updateCommandTreeForPlayervoid updateCommandTreeForPlayer(ServerPlayer player) Asks the server to send an updated client completion command tree to the specifiedServerPlayer.This should be used sparingly as repeated calls may cause performance issues. Implementations may choose to ignore this call if it deems it unnecessary to send an update. This method may return before the updates have been sent. - Parameters:
- player- The- ServerPlayerto send the command tree to.
 
 
- 
 
-