Fix FillBucketEvent to work with stacked buckets. New change in 1.3

This commit is contained in:
LexManos 2012-09-11 12:45:29 -07:00
parent 2b9a80bfdd
commit 8882388902

View file

@ -8,7 +8,7 @@
public class ItemBucket extends Item
{
@@ -31,6 +34,17 @@
@@ -31,6 +34,32 @@
}
else
{
@ -20,8 +20,23 @@
+
+ if (event.isHandeled())
+ {
+ 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)
{