/// <summary> /// Called when a player right clicks a entity with a item. /// </summary> public override void UseItemOnEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving) { if (par2EntityLiving is EntitySheep) { EntitySheep entitysheep = (EntitySheep)par2EntityLiving; int i = BlockCloth.GetBlockFromDye(par1ItemStack.GetItemDamage()); if (!entitysheep.GetSheared() && entitysheep.GetFleeceColor() != i) { entitysheep.SetFleeceColor(i); par1ItemStack.StackSize--; } } }
public override string GetItemNameIS(ItemStack par1ItemStack) { return((new StringBuilder()).Append(base.GetItemName()).Append(".").Append(ItemDye.DyeColorNames[BlockCloth.GetBlockFromDye(par1ItemStack.GetItemDamage())]).ToString()); }
/// <summary> /// Gets an icon index based on an item's damage value /// </summary> public override int GetIconFromDamage(int par1) { return(Block.Cloth.GetBlockTextureFromSideAndMetadata(2, BlockCloth.GetBlockFromDye(par1))); }