001 package net.minecraftforge.event.entity.player;
002
003 import net.minecraft.entity.player.EntityPlayer;
004 import net.minecraft.item.ItemStack;
005 import net.minecraft.util.MovingObjectPosition;
006 import net.minecraft.world.World;
007 import net.minecraftforge.event.Cancelable;
008 import net.minecraftforge.event.Event;
009
010 @Cancelable
011 @Event.HasResult
012 public class FillBucketEvent extends PlayerEvent
013 {
014 /**
015 * This event is fired when a player attempts to use a Empty bucket, it
016 * can be canceled to completely prevent any further processing.
017 *
018 * If you set the result to 'ALLOW', it means that you have processed
019 * the event and wants the basic functionality of adding the new
020 * ItemStack to your inventory and reducing the stack size to process.
021 * setResult(ALLOW) is the same as the old setHandeled();
022 */
023
024 public final ItemStack current;
025 public final World world;
026 public final MovingObjectPosition target;
027
028 public ItemStack result;
029
030 public FillBucketEvent(EntityPlayer player, ItemStack current, World world, MovingObjectPosition target)
031 {
032 super(player);
033 this.current = current;
034 this.world = world;
035 this.target = target;
036 }
037 }