2012-08-06 22:07:53 +00:00
|
|
|
package net.minecraftforge.event.entity.player;
|
|
|
|
|
|
|
|
import net.minecraft.src.Entity;
|
|
|
|
import net.minecraft.src.EntityItem;
|
|
|
|
import net.minecraft.src.EntityPlayer;
|
2012-08-07 08:24:06 +00:00
|
|
|
import net.minecraftforge.event.Cancelable;
|
2012-10-22 07:29:28 +00:00
|
|
|
import net.minecraftforge.event.Event;
|
2012-08-06 22:07:53 +00:00
|
|
|
|
2012-08-07 08:24:06 +00:00
|
|
|
@Cancelable
|
2012-10-22 07:29:28 +00:00
|
|
|
@Event.HasResult
|
2012-08-06 22:07:53 +00:00
|
|
|
public class EntityItemPickupEvent extends PlayerEvent
|
|
|
|
{
|
2012-10-22 07:29:28 +00:00
|
|
|
/**
|
|
|
|
* This event is called when a player collides with a EntityItem on the ground.
|
|
|
|
* The event can be canceled, and no further processing will be done.
|
|
|
|
*
|
|
|
|
* You can set the result of this event to ALLOW which will trigger the
|
|
|
|
* processing of achievements, FML's event, play the sound, and kill the
|
|
|
|
* entity if all the items are picked up.
|
|
|
|
*
|
|
|
|
* setResult(ALLOW) is the same as the old setHandled()
|
|
|
|
*/
|
|
|
|
|
2012-08-06 22:07:53 +00:00
|
|
|
public final EntityItem item;
|
2012-08-17 20:31:47 +00:00
|
|
|
private boolean handled = false;
|
2012-10-22 07:29:28 +00:00
|
|
|
|
2012-08-06 22:07:53 +00:00
|
|
|
public EntityItemPickupEvent(EntityPlayer player, EntityItem item)
|
|
|
|
{
|
|
|
|
super(player);
|
|
|
|
this.item = item;
|
|
|
|
}
|
|
|
|
}
|