package net.minecraft.item;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.passive.EntityPig;
public class ItemSaddle extends Item
{
public ItemSaddle(int par1)
{
super(par1);
this.maxStackSize = 1;
this.setCreativeTab(CreativeTabs.tabTransport);
}
/**
* dye sheep, place saddles, etc ...
*/
public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving)
{
if (par2EntityLiving instanceof EntityPig)
{
EntityPig var3 = (EntityPig)par2EntityLiving;
if (!var3.getSaddled() && !var3.isChild())
{
var3.setSaddled(true);
--par1ItemStack.stackSize;
}
return true;
}
else
{
return false;
}
}
/**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
this.itemInteractionForEntity(par1ItemStack, par2EntityLiving);
return true;
}
}