Interface CommandManager.Mutable

    • Method Detail

      • registerAlias

        CommandMapping registerAlias​(CommandRegistrar<?> registrar,
                                     org.spongepowered.plugin.PluginContainer container,
                                     CommandTreeNode.Root commandTree,
                                     String primaryAlias,
                                     String... secondaryAliases)
                              throws CommandFailedRegistrationException
        Registers a set of command aliases with this manager. This method should only be used by plugins that implement their own command framework, as described in the description of the CommandRegistrar class.

        When registering a command, any aliases provided are prefixed with the plugin's ID, followed by a colon to provide command namespacing in addition to the unnamespaced aliases. As an example, if a plugin with ID foo tries to register the command bar, the command manager will attempt to register the commands /bar and /foo:bar.

        Command aliases may not contain whitespace.

        If you wish to inspect the aliases that were registered, you may inspect the returned CommandMapping for the registered aliases.

        Parameters:
        registrar - The CommandRegistrar that is requesting the aliases
        container - The PluginContainer to register the command for
        commandTree - The CommandTreeNode that represents this command structure.
        primaryAlias - The first command alias to register
        secondaryAliases - Secondary aliases to register, if any
        Returns:
        The CommandMapping containing the command mapping information.
        Throws:
        CommandFailedRegistrationException - thrown if the command could not be registered.