From 58fc45619f2c54fa87af202a645b5ec9560c52d8 Mon Sep 17 00:00:00 2001 From: LexManos Date: Sat, 25 Aug 2012 00:30:32 -0700 Subject: [PATCH] Fix FillBucketEvent to actually fire. --- .../net/minecraft/src/ItemBucket.java.patch | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/patches/common/net/minecraft/src/ItemBucket.java.patch b/patches/common/net/minecraft/src/ItemBucket.java.patch index 2b5bcb2bc..4b33a0c21 100644 --- a/patches/common/net/minecraft/src/ItemBucket.java.patch +++ b/patches/common/net/minecraft/src/ItemBucket.java.patch @@ -1,35 +1,28 @@ --- ../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; + } -+ ++ + if (event.isHandeled()) + { + return event.result; + } -+ ++ if (var12.typeOfHit == EnumMovingObjectType.TILE) { int var13 = var12.blockX; -@@ -41,6 +54,7 @@ - { - return par1ItemStack; - } -+ - - if (this.isFull == 0) - {