Fix FillBucketEvent to actually fire.

This commit is contained in:
LexManos 2012-08-25 00:30:32 -07:00
parent 8fc05c399a
commit 58fc45619f

View file

@ -1,18 +1,19 @@
--- ../src_base/common/net/minecraft/src/ItemBucket.java
+++ ../src_work/common/net/minecraft/src/ItemBucket.java
@@ -1,4 +1,6 @@
@@ -1,4 +1,7 @@
package net.minecraft.src;
+
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.player.FillBucketEvent;
public class ItemBucket extends Item
{
@@ -31,6 +33,17 @@
@@ -31,6 +34,17 @@
}
else
{
+ FillBucketEvent event = new FillBucketEvent(par3EntityPlayer, par1ItemStack, par2World, var12);
+ if (event.isCanceled())
+ if (MinecraftForge.EVENT_BUS.post(event))
+ {
+ return par1ItemStack;
+ }
@ -25,11 +26,3 @@
if (var12.typeOfHit == EnumMovingObjectType.TILE)
{
int var13 = var12.blockX;
@@ -41,6 +54,7 @@
{
return par1ItemStack;
}
+
if (this.isFull == 0)
{