Пример #1
0
        /// <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--;
                }
            }
        }
Пример #2
0
 public override string GetItemNameIS(ItemStack par1ItemStack)
 {
     return((new StringBuilder()).Append(base.GetItemName()).Append(".").Append(ItemDye.DyeColorNames[BlockCloth.GetBlockFromDye(par1ItemStack.GetItemDamage())]).ToString());
 }
Пример #3
0
 /// <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)));
 }