    001package net.minecraftforge.event.entity.player;
    002
    003import net.minecraft.block.Block;
    004import net.minecraft.entity.Entity;
    005import net.minecraft.entity.player.EntityPlayer;
    006import net.minecraftforge.event.Cancelable;
    007import net.minecraftforge.event.entity.living.LivingEvent;
    008
    009public class PlayerEvent extends LivingEvent
    010{
    011    public final EntityPlayer entityPlayer;
    012    public PlayerEvent(EntityPlayer player)
    013    {
    014        super(player);
    015        entityPlayer = player;
    016    }
    017
    018    public static class HarvestCheck extends PlayerEvent
    019    {
    020        public final Block block;
    021        public boolean success;
    022
    023        public HarvestCheck(EntityPlayer player, Block block, boolean success)
    024        {
    025            super(player);
    026            this.block = block;
    027            this.success = success;
    028        }
    029    }
    030
    031    @Cancelable
    032    public static class BreakSpeed extends PlayerEvent
    033    {
    034        public final Block block;
    035        public final int metadata;
    036        public final float originalSpeed;
    037        public float newSpeed = 0.0f;
    038
    039        public BreakSpeed(EntityPlayer player, Block block, int metadata, float original)
    040        {
    041            super(player);
    042            this.block = block;
    043            this.metadata = metadata;
    044            this.originalSpeed = original;
    045            this.newSpeed = original;
    046        }
    047    }
    048}