001package net.minecraftforge.event.entity.item;
002
003import net.minecraft.entity.item.EntityItem;
004import net.minecraft.entity.player.EntityPlayer;
005import net.minecraftforge.event.Cancelable;
006import net.minecraftforge.event.entity.EntityEvent;
007
008/**
009 * Event that is fired whenever a player tosses (Q) an item or drag-n-drops a
010 * stack of items outside the inventory GUI screens. Canceling the event will
011 * stop the items from entering the world, but will not prevent them being
012 * removed from the inventory - and thus removed from the system.
013 */
014@Cancelable
015public class ItemTossEvent extends ItemEvent
016{
017
018    /**
019     * The player tossing the item.
020     */
021    public final EntityPlayer player;
022
023    /**
024     * Creates a new event for EntityItems tossed by a player.
025     * 
026     * @param entityItem The EntityItem being tossed.
027     * @param player The player tossing the item.
028     */
029    public ItemTossEvent(EntityItem entityItem, EntityPlayer player)
030    {
031        super(entityItem);
032        this.player = player;
033    }
034}