Esempio n. 1
0
        /// <summary>
        /// Heals the player and removes a slice from the cake.
        /// </summary>
        private void EatCakeSlice(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
        {
            if (par5EntityPlayer.CanEat(false))
            {
                par5EntityPlayer.GetFoodStats().AddStats(2, 0.1F);
                int i = par1World.GetBlockMetadata(par2, par3, par4) + 1;

                if (i >= 6)
                {
                    par1World.SetBlockWithNotify(par2, par3, par4, 0);
                }
                else
                {
                    par1World.SetBlockMetadataWithNotify(par2, par3, par4, i);
                    par1World.MarkBlockAsNeedsUpdate(par2, par3, par4);
                }
            }
        }