ForgePatch/common/net/minecraftforge/event/entity/player/PlayerDropsEvent.java
LexManos 03d1e51764 New EntityItem related events
Fixed player death event in SMP
Added Player specific drops event
Added generic EntityJoinWorldEvent
2012-09-11 15:27:34 -07:00

35 lines
No EOL
1.2 KiB
Java

package net.minecraftforge.event.entity.player;
import java.util.ArrayList;
import net.minecraft.src.*;
import net.minecraftforge.event.Cancelable;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
/**
* Child class of LivingDropEvent that is fired specifically when a
* player dies. Canceling the event will prevent ALL drops from entering the
* world.
*/
@Cancelable
public class PlayerDropsEvent extends LivingDropsEvent
{
public final EntityPlayer entityPlayer;
/**
* Creates a new event containing all the items that will drop into the
* world when a player dies.
* @param entity The dying player.
* @param source The source of the damage which is killing the player.
* @param drops List of all drops entering the world.
*/
public PlayerDropsEvent(EntityPlayer entity, DamageSource source, ArrayList<EntityItem> drops, boolean recentlyHit)
{
super(entity, source, drops,
(source.getEntity() instanceof EntityPlayer) ?
EnchantmentHelper.getLootingModifier(((EntityPlayer)source.getEntity()).inventory) : 0,
recentlyHit, 0);
this.entityPlayer = entity;
}
}