コード例 #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 EntityPig)
            {
                EntityPig entitypig = (EntityPig)par2EntityLiving;

                if (!entitypig.GetSaddled() && !entitypig.IsChild())
                {
                    entitypig.SetSaddled(true);
                    par1ItemStack.StackSize--;
                }
            }
        }