Пример #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="c"></param>
 public override void Generate(Chunk c)
 {
     //DateTime start = DateTime.Now;
     //int cx = c.x << 4, cz = c.z << 4;
     //int waterLevel = 64 + 15 / 2 - 4;
     if (worldObj.seed == 0)
     {
         for (int x = 0; x < 16; ++x)
         {
             for (int z = 0; z < 16; ++z)
             {
                 for (int y = 0; y < 1; ++y)
                 {
                     c.UNCHECKEDPlaceBlock(x, y, z, 0x07);
                 }
                 for (int y = 1; y < 50; ++y)
                 {
                     c.UNCHECKEDPlaceBlock(x, y, z, 0x01);
                 }
                 for (int y = 50; y < 65; ++y)
                 {
                     c.UNCHECKEDPlaceBlock(x, y, z, 0x03);
                 }
                 c.UNCHECKEDPlaceBlock(x, 65, z, 0x02);
             }
         }
     }
     else
     {
         lock (this.Lock) // We have to do this otherwise shit gets f****d.
         {
             random.setSeed((long)c.x * 0x4f9939f508L + (long)c.z * 0x1ef1565bd5L);
             generateTerrain(c.x, c.z, c.blocks);
             biomesForGeneration = worldObj.chunkManager.loadBlockGeneratorData(biomesForGeneration, c.x * 16, c.z * 16, 16, 16);
             replaceBlocksForBiome(c.x, c.z, c.blocks, biomesForGeneration);
             caveGenerator.generate(worldObj, c.x, c.z, c.blocks);
             if (mapFeaturesEnabled)
             {
                 //mineshaftGenerator.generate(this, worldObj, i, j, abyte0);
                 //villageGenerator.generate(this, worldObj, i, j, abyte0);
                 //strongholdGenerator.generate(this, worldObj, i, j, abyte0);
             }
             ravineGenerator.generate(worldObj, c.x, c.z, c.blocks);
             c.GenerateHeightMap();
         }
     }
     //TimeSpan took = DateTime.Now - start;
     //Console.WriteLine(took.TotalMilliseconds);
 }
Пример #2
0
        public override bool generate(World world, Random random, int i, int j, int k)
        {
            worldObj = world;
            long l = random.nextLong();

            field_759_b.setSeed(l);
            basePos[0] = i;
            basePos[1] = j;
            basePos[2] = k;
            if (field_756_e == 0)
            {
                field_756_e = 5 + field_759_b.nextInt(field_748_m);
            }
            if (!func_422_e())
            {
                return(false);
            }
            else
            {
                func_424_a();
                func_421_b();
                func_432_c();
                func_428_d();
                return(true);
            }
        }