/*
 * This file is part of SpongeAPI, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered <https://www.spongepowered.org>
 * Copyright (c) contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.spongepowered.api.event.lifecycle;

import org.spongepowered.api.command.Command;
import org.spongepowered.api.command.manager.CommandFailedRegistrationException;
import org.spongepowered.api.command.manager.CommandMapping;
import org.spongepowered.api.command.registrar.CommandRegistrar;
import org.spongepowered.api.event.GenericEvent;
import org.spongepowered.plugin.PluginContainer;

/**
 * Lifecycle event to indicate when commands should be registered.
 *
 * <p>There are two types command that Sponge will always call an event for:</p>
 *
 * <ul>
 *     <li>Where {@link C} is {@link Command.Raw}; and</li>
 *     <li>Where {@link C} is {@link Command.Parameterized}.</li>
 * </ul>
 *
 * <p>Other plugins may provide a {@link CommandRegistrar} that allows for other
 * types to be registered as commands. These types will be provided by these
 * other plugins.</p>
 *
 * @param <C> The type of command that is being registered.
 */
public interface RegisterCommandEvent<C> extends GenericEvent<C>, LifecycleEvent {

    /**
     * Registers a command with the appropriate {@link CommandRegistrar}.
     *
     * @param container The {@link PluginContainer}
     * @param command The command to register
     * @param alias The first alias to register for this command
     * @param aliases Any other aliases to register
     * @return The {@link CommandMapping}, indicating which aliases have been
     *         registered for this command
     * @throws CommandFailedRegistrationException if registration failed
     */
    CommandMapping registerMapping(PluginContainer container, C command, String alias, String... aliases) throws CommandFailedRegistrationException;

    /**
     * Registers a command with the appropriate {@link CommandRegistrar}.
     *
     * @param container The {@link PluginContainer}
     * @param command The command to register
     * @param alias The first alias to register for this command
     * @param aliases Any other aliases to register
     * @return The {@link CommandMapping}, indicating which aliases have been
     *         registered for this command
     * @throws CommandFailedRegistrationException if registration failed
     */
    RegisterCommandEvent<C> register(PluginContainer container, C command, String alias, String... aliases) throws CommandFailedRegistrationException;
}

@@ -2613,59 +2613,143 @@
 ink 
-CommandMapping%7D, indicating which aliases have been
+Result%7D, which contains the %7B@link CommandMapping%7D for%0A     *      this registration, while also allowing for chaining of other command
 %0A   
@@ -2761,38 +2761,22 @@
     
- 
-  
 regist
-ered for this command
+rations.
 %0A   
@@ -2857,30 +2857,25 @@
  */%0A    
-CommandMapping
+Result%3CC%3E
  registe
@@ -2875,23 +2875,16 @@
 register
-Mapping
 (PluginC
@@ -2997,32 +2997,320 @@
 %0A%0A    /**%0A     *
+ The %7B@link Result%7D of a command registration, allowing for the chaining%0A     * of other command registrations, or the retrival of the%0A     * %7B@link CommandMapping%7D generated from the registration that returned this%0A     * result.%0A     */%0A    interface Result%3CC%3E %7B%0A%0A        /**%0A         *
  Registers a com
@@ -3358,34 +3358,42 @@
 egistrar%7D.%0A     
-*%0A
+    *%0A    
      * @param co
@@ -3425,32 +3425,36 @@
 Container%7D%0A     
+    
 * @param command
@@ -3475,32 +3475,36 @@
 o register%0A     
+ 
+   
 * @param alias T
@@ -3539,32 +3539,36 @@
 or this command%0A
+    
      * @param al
@@ -3600,32 +3600,36 @@
 o register%0A     
+    
 * @return The %7B@
@@ -3637,60 +3637,152 @@
 ink 
-CommandMapping%7D, indicating which aliases have been%0A
+Result%7D, which contains the %7B@link CommandMapping%7D for%0A         *      this registration, while also allowing for chaining of other command%0A    
     
@@ -3793,39 +3793,27 @@
     
-   
 regist
-ered for this command%0A
+rations.%0A    
     
@@ -3890,34 +3890,28 @@
     
+    
 */%0A    
+ 
-RegisterCommandEven
+   Resul
 t%3CC%3E
@@ -4034,10 +4034,213 @@
 eption;%0A
+%0A        /**%0A         * The %7B@link CommandMapping%7D generated for the previous registration.%0A         *%0A         * @return The %7B@link CommandMapping%7D%0A         */%0A        CommandMapping mapping();%0A%0A    %7D%0A%0A
 %7D%0A

Update RegisterCommandEvent