package net.minecraft.item;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.world.World;
public class ItemBucketMilk extends Item
{
private static final String __OBFID = "CL_00000048";
public ItemBucketMilk()
{
this.setMaxStackSize(1);
this.setCreativeTab(CreativeTabs.tabMisc);
}
/**
* Called when the item in use count reach 0, e.g. item food eaten. Return the new ItemStack. Args : stack, world,
* entity
*/
public ItemStack onItemUseFinish(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_)
{
if (!p_77654_3_.capabilities.isCreativeMode)
{
--p_77654_1_.stackSize;
}
if (!p_77654_2_.isRemote)
{
p_77654_3_.curePotionEffects(p_77654_1_);
}
return p_77654_1_.stackSize <= 0 ? new ItemStack(Items.bucket) : p_77654_1_;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack p_77626_1_)
{
return 32;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack stack)
{
return EnumAction.drink;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player)
{
player.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn));
return itemStackIn;
}
}