///<summary>
        /// Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
        /// specified chunk from the map seed and chunk seed
        ///</summary>
        public Chunk ProvideChunk(int par1, int par2)
        {
            rand.SetSeed(par1 * 0x4f9939f5 + par2 * 0x1ef1565b);
            byte[] abyte0 = new byte[32768];
            GenerateTerrain(par1, par2, abyte0);
            biomesForGeneration = worldObj.GetWorldChunkManager().LoadBlockGeneratorData(biomesForGeneration, par1 * 16, par2 * 16, 16, 16);
            ReplaceBlocksForBiome(par1, par2, abyte0, biomesForGeneration);
            caveGenerator.Generate(this, worldObj, par1, par2, abyte0);
            ravineGenerator.Generate(this, worldObj, par1, par2, abyte0);

            if (mapFeaturesEnabled)
            {
                mineshaftGenerator.Generate(this, worldObj, par1, par2, abyte0);
                villageGenerator.Generate(this, worldObj, par1, par2, abyte0);
                strongholdGenerator.Generate(this, worldObj, par1, par2, abyte0);
            }

            Chunk chunk = new Chunk(worldObj, abyte0, par1, par2);

            byte[] abyte1 = chunk.GetBiomeArray();

            for (int i = 0; i < abyte1.Length; i++)
            {
                abyte1[i] = (byte)biomesForGeneration[i].BiomeID;
            }

            chunk.GenerateSkylightMap();
            return(chunk);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
        /// specified chunk from the map seed and chunk seed
        /// </summary>
        public Chunk ProvideChunk(int par1, int par2)
        {
            byte[] abyte0 = new byte[32768];
            Generate(abyte0);
            Chunk chunk = new Chunk(WorldObj, abyte0, par1, par2);

            if (UseStructures)
            {
                VillageGen.Generate(this, WorldObj, par1, par2, abyte0);
            }

            BiomeGenBase[] abiomegenbase = WorldObj.GetWorldChunkManager().LoadBlockGeneratorData(null, par1 * 16, par2 * 16, 16, 16);
            byte[]         abyte1        = chunk.GetBiomeArray();

            for (int i = 0; i < abyte1.Length; i++)
            {
                abyte1[i] = (byte)abiomegenbase[i].BiomeID;
            }

            chunk.GenerateSkylightMap();
            return(chunk);
        }