/*
 * 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.item.inventory;

import org.spongepowered.api.entity.living.Living;
import org.spongepowered.api.event.Cancellable;
import org.spongepowered.api.event.Event;
import org.spongepowered.api.event.entity.item.TargetItemEvent;
import org.spongepowered.api.item.inventory.Inventory;
import org.spongepowered.api.item.inventory.ItemStack;

public interface ChangeInventoryEvent extends TargetInventoryEvent, AffectSlotEvent {

    /**
     * Fired when a {@link Living} changes it's equipment.
     */
    interface Equipment extends ChangeInventoryEvent {}

    /**
     * Fired when a {@link Living} changes it's held {@link ItemStack}.
     */
    interface Held extends ChangeInventoryEvent {}

    /**
     * Fired when an {@link Inventory} transfers items into another.
     */
    interface Transfer extends ChangeInventoryEvent {

        /**
         * Gets the source {@link Inventory} of this {@link Event}.
         *
         * @return The source {@link Inventory}
         */
        Inventory getSourceInventory();

        /**
         * Fired before an {@link Inventory} attempts to transfer items.
         */
        interface Pre extends TargetInventoryEvent, Cancellable {

            /**
             * Gets the source {@link Inventory} of this {@link Event}.
             *
             * @return The source {@link Inventory}
             */
            Inventory getSourceInventory();

            /**
             * Gets the target {@link Inventory} of this {@link Event}.
             *
             * @return The target {@link Inventory}
             */
            @Override
            Inventory getTargetInventory();
        }

        /**
         * Fires after an {@link Inventory} transferred an item.
         */
        interface Post extends Transfer {}

    }

    interface Pickup extends ChangeInventoryEvent, TargetItemEvent {}
}

@@ -1297,16 +1297,58 @@
 ntory;%0A%0A
+import org.spongepowered.api.entity.Item;%0A
 import o
@@ -1653,16 +1653,207 @@
 emStack;
+%0Aimport org.spongepowered.api.item.inventory.ItemStackSnapshot;%0Aimport org.spongepowered.api.util.annotation.eventgen.GenerateFactoryMethod;%0A%0Aimport java.util.List;%0Aimport java.util.Optional;
 %0A%0Apublic
@@ -2054,32 +2054,38 @@
 InventoryEvent %7B
+%0A%0A    
 %7D%0A%0A    /**%0A     
@@ -2208,16 +2208,22 @@
 yEvent %7B
+%0A%0A    
 %7D%0A%0A    /
@@ -3311,86 +3311,1813 @@
 er %7B
-%7D%0A%0A    %7D%0A%0A    interface Pickup extends ChangeInventoryEvent, TargetItemEvent %7B
+%0A%0A        %7D%0A%0A    %7D%0A%0A    /**%0A     * Fires after an %7B@link Item%7D has been picked up.%0A     */%0A    @GenerateFactoryMethod%0A    interface Pickup extends ChangeInventoryEvent %7B%0A%0A        /**%0A         * Fires before an %7B@link Item%7D is picked up.%0A         *%0A         * %3Cp%3EModifying the picked up items causes this event to be automatically canceled if the inventory does not fit the entire list.%3C/p%3E%0A         */%0A        interface Pre extends TargetInventoryEvent, TargetItemEvent, Cancellable %7B%0A%0A            /**%0A             * Returns the original picked up %7B@link ItemStackSnapshot%7D to add to the inventory.%0A             *%0A             * @return The original picked up item%0A             */%0A            default ItemStackSnapshot getOriginalStack() %7B%0A                return this.getTargetEntity().item().get();%0A            %7D%0A%0A            /**%0A             * Returns the custom set list of items to add to the inventory or %7B@link Optional#empty()%7D if not set.%0A             *%0A             * @return The custom set list%0A             */%0A            Optional%3CList%3CItemStackSnapshot%3E%3E getCustom();%0A%0A            /**%0A             * Sets the items to add to the inventory.%0A             *%0A             * %3Cp%3EIf all items do not fit the inventory this event will be automatically canceled.%3C/p%3E%0A             *%0A             * @param items The items to add to the inventory%0A             */%0A            void setCustom(List%3CItemStackSnapshot%3E items);%0A%0A            /**%0A             * Returns the proposed final list of items to add to the inventory.%0A             *%0A             * %3Cp%3EIf a custom list was set all items have to fit the inventory or this event will be automatically canceled.%3C/p%3E%0A             *%0A             * @return The proposed final list%0A             */%0A            List%3CItemStackSnapshot%3E getFinal();%0A%0A        %7D%0A    
 %7D%0A%7D%0A

split up pickup event