Exemplo n.º 1
0
 public ChunkProviderEnd(World par1World, long par2)
 {
     Field_40395_h = JavaHelper.ReturnRectangularArray <int>(32, 32);
     endWorld      = par1World;
     endRNG        = new Random((int)par2);
     noiseGen1     = new NoiseGeneratorOctaves(endRNG, 16);
     noiseGen2     = new NoiseGeneratorOctaves(endRNG, 16);
     noiseGen3     = new NoiseGeneratorOctaves(endRNG, 8);
     NoiseGen4     = new NoiseGeneratorOctaves(endRNG, 10);
     NoiseGen5     = new NoiseGeneratorOctaves(endRNG, 16);
 }
 public ChunkProviderGenerate(World par1World, long par2, bool par4)
 {
     stoneNoise          = new double[256];
     caveGenerator       = new MapGenCaves();
     strongholdGenerator = new MapGenStronghold();
     villageGenerator    = new MapGenVillage(0);
     mineshaftGenerator  = new MapGenMineshaft();
     ravineGenerator     = new MapGenRavine();
     Field_914_i         = JavaHelper.ReturnRectangularArray <int>(32, 32);
     worldObj            = par1World;
     mapFeaturesEnabled  = par4;
     rand            = new Random((int)par2);
     noiseGen1       = new NoiseGeneratorOctaves(rand, 16);
     noiseGen2       = new NoiseGeneratorOctaves(rand, 16);
     noiseGen3       = new NoiseGeneratorOctaves(rand, 8);
     noiseGen4       = new NoiseGeneratorOctaves(rand, 4);
     NoiseGen5       = new NoiseGeneratorOctaves(rand, 10);
     NoiseGen6       = new NoiseGeneratorOctaves(rand, 16);
     MobSpawnerNoise = new NoiseGeneratorOctaves(rand, 8);
 }
Exemplo n.º 3
0
 public EntityDragon(World par1World)
     : base(par1World)
 {
     //ORIGINAL LINE: Field_40162_d = new double[64][3];
     //JAVA TO C# CONVERTER NOTE: The following call to the 'RectangularArrays' helper class reproduces the rectangular array initialization that is automatic in Java:
     Field_40162_d       = JavaHelper.ReturnRectangularArray <float>(64, 3);
     Field_40164_e       = -1;
     Field_40173_aw      = 0.0F;
     Field_40172_ax      = 0.0F;
     Field_40163_ay      = false;
     Field_40161_az      = false;
     Field_40178_aA      = 0;
     HealingEnderCrystal = null;
     DragonPartArray     = (new EntityDragonPart[] { DragonPartHead = new EntityDragonPart(this, "head", 6F, 6F), DragonPartBody = new EntityDragonPart(this, "body", 8F, 8F), DragonPartTail1 = new EntityDragonPart(this, "tail", 4F, 4F), DragonPartTail2 = new EntityDragonPart(this, "tail", 4F, 4F), DragonPartTail3 = new EntityDragonPart(this, "tail", 4F, 4F), DragonPartWing1 = new EntityDragonPart(this, "wing", 4F, 4F), DragonPartWing2 = new EntityDragonPart(this, "wing", 4F, 4F) });
     MaxHealth = 200;
     SetEntityHealth(MaxHealth);
     Texture = "/mob/enderdragon/ender.png";
     SetSize(16F, 8F);
     NoClip = true;
     isImmuneToFire_Renamed = true;
     TargetY            = 100;
     IgnoreFrustumCheck = true;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Generates a list of leaf nodes for the tree, to be populated by generateLeaves.
        /// </summary>
        public virtual void GenerateLeafNodeList()
        {
            Height = (int)((double)HeightLimit * HeightAttenuation);

            if (Height >= HeightLimit)
            {
                Height = HeightLimit - 1;
            }

            int i = (int)(1.3819999999999999D + Math.Pow((LeafDensity * (double)HeightLimit) / 13D, 2D));

            if (i < 1)
            {
                i = 1;
            }

            int[][] ai = JavaHelper.ReturnRectangularArray <int>(i * HeightLimit, 4);
            int     j  = (BasePos[1] + HeightLimit) - LeafDistanceLimit;
            int     k  = 1;
            int     l  = BasePos[1] + Height;
            int     i1 = j - BasePos[1];

            ai[0][0] = BasePos[0];
            ai[0][1] = j;
            ai[0][2] = BasePos[2];
            ai[0][3] = l;
            j--;

            while (i1 >= 0)
            {
                int   j1 = 0;
                float f  = LayerSize(i1);

                if (f < 0.0F)
                {
                    j--;
                    i1--;
                }
                else
                {
                    double d = 0.5D;

                    for (; j1 < i; j1++)
                    {
                        double d1  = ScaleWidth * ((double)f * ((double)Rand.NextFloat() + 0.32800000000000001D));
                        double d2  = (double)Rand.NextFloat() * 2D * Math.PI;
                        int    k1  = MathHelper2.Floor_double(d1 * Math.Sin(d2) + (double)BasePos[0] + d);
                        int    l1  = MathHelper2.Floor_double(d1 * Math.Cos(d2) + (double)BasePos[2] + d);
                        int[]  ai1 = { k1, j, l1 };
                        int[]  ai2 = { k1, j + LeafDistanceLimit, l1 };

                        if (CheckBlockLine(ai1, ai2) != -1)
                        {
                            continue;
                        }

                        int[]  ai3 = { BasePos[0], BasePos[1], BasePos[2] };
                        double d3  = Math.Sqrt(Math.Pow(Math.Abs(BasePos[0] - ai1[0]), 2D) + Math.Pow(Math.Abs(BasePos[2] - ai1[2]), 2D));
                        double d4  = d3 * BranchSlope;

                        if ((double)ai1[1] - d4 > (double)l)
                        {
                            ai3[1] = l;
                        }
                        else
                        {
                            ai3[1] = (int)((double)ai1[1] - d4);
                        }

                        if (CheckBlockLine(ai3, ai1) == -1)
                        {
                            ai[k][0] = k1;
                            ai[k][1] = j;
                            ai[k][2] = l1;
                            ai[k][3] = ai3[1];
                            k++;
                        }
                    }

                    j--;
                    i1--;
                }
            }

            LeafNodes = JavaHelper.ReturnRectangularArray <int>(k, 4);
            Array.Copy(ai, 0, LeafNodes, 0, k);
        }
Exemplo n.º 5
0
        public TexturePortalFX() : base(Block.Portal.BlockIndexInTexture)
        {
            PortalTickCounter = 0;
            PortalTextureData = JavaHelper.ReturnRectangularArray <sbyte>(32, 1024);
            Random random = new Random(100);

            for (int i = 0; i < 32; i++)
            {
                for (int j = 0; j < 16; j++)
                {
                    for (int k = 0; k < 16; k++)
                    {
                        float f = 0.0F;

                        for (int l = 0; l < 2; l++)
                        {
                            float f1 = (float)(l * 16) * 0.5F;
                            float f2 = (float)(l * 16) * 0.5F;
                            float f3 = (((float)j - f1) / 16F) * 2.0F;
                            float f4 = (((float)k - f2) / 16F) * 2.0F;

                            if (f3 < -1F)
                            {
                                f3 += 2.0F;
                            }

                            if (f3 >= 1.0F)
                            {
                                f3 -= 2.0F;
                            }

                            if (f4 < -1F)
                            {
                                f4 += 2.0F;
                            }

                            if (f4 >= 1.0F)
                            {
                                f4 -= 2.0F;
                            }

                            float f5 = f3 * f3 + f4 * f4;
                            float f6 = (float)Math.Atan2(f4, f3) + ((((float)i / 32F) * (float)Math.PI * 2.0F - f5 * 10F) + (float)(l * 2)) * (float)(l * 2 - 1);
                            f6  = (MathHelper2.Sin(f6) + 1.0F) / 2.0F;
                            f6 /= f5 + 1.0F;
                            f  += f6 * 0.5F;
                        }

                        f += random.NextFloat() * 0.1F;
                        int i1 = (int)(f * 100F + 155F);
                        int j1 = (int)(f * f * 200F + 55F);
                        int k1 = (int)(f * f * f * f * 255F);
                        int l1 = (int)(f * 100F + 155F);
                        int i2 = k * 16 + j;
                        PortalTextureData[i][i2 * 4 + 0] = (sbyte)j1;
                        PortalTextureData[i][i2 * 4 + 1] = (sbyte)k1;
                        PortalTextureData[i][i2 * 4 + 2] = (sbyte)i1;
                        PortalTextureData[i][i2 * 4 + 3] = (sbyte)l1;
                    }
                }
            }
        }