Ejemplo n.º 1
0
        protected override void Func_40071_a(MovingObjectPosition par1MovingObjectPosition)
        {
            if (!WorldObj.IsRemote)
            {
                if (par1MovingObjectPosition.EntityHit != null)
                {
                    if (!par1MovingObjectPosition.EntityHit.IsImmuneToFire() && par1MovingObjectPosition.EntityHit.AttackEntityFrom(DamageSource.CauseFireballDamage(this, ShootingEntity), 5))
                    {
                        par1MovingObjectPosition.EntityHit.SetFire(5);
                    }
                }
                else
                {
                    int i = par1MovingObjectPosition.BlockX;
                    int j = par1MovingObjectPosition.BlockY;
                    int k = par1MovingObjectPosition.BlockZ;

                    switch (par1MovingObjectPosition.SideHit)
                    {
                    case 1:
                        j++;
                        break;

                    case 0:
                        j--;
                        break;

                    case 2:
                        k--;
                        break;

                    case 3:
                        k++;
                        break;

                    case 5:
                        i++;
                        break;

                    case 4:
                        i--;
                        break;
                    }

                    if (WorldObj.IsAirBlock(i, j, k))
                    {
                        WorldObj.SetBlockWithNotify(i, j, k, Block.Fire.BlockID);
                    }
                }

                SetDead();
            }
        }