Skip to content

Commit

Permalink
Fix FillBucketEvent to work with stacked buckets. New change in 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
LexManos committed Sep 11, 2012
1 parent 2b9a80b commit 8882388
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions patches/common/net/minecraft/src/ItemBucket.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class ItemBucket extends Item
{
@@ -31,6 +34,17 @@
@@ -31,6 +34,32 @@
}
else
{
Expand All @@ -20,7 +20,22 @@
+
+ if (event.isHandeled())
+ {
+ return event.result;
+ if (par3EntityPlayer.capabilities.isCreativeMode)
+ {
+ return par1ItemStack;
+ }
+
+ if (--par1ItemStack.stackSize <= 0)
+ {
+ return event.result;
+ }
+
+ if (!par3EntityPlayer.inventory.addItemStackToInventory(event.result))
+ {
+ par3EntityPlayer.dropPlayerItem(event.result);
+ }
+
+ return par1ItemStack;
+ }
+
if (var12.typeOfHit == EnumMovingObjectType.TILE)
Expand Down

0 comments on commit 8882388

Please sign in to comment.