Esempio n. 1
0
        private Vec3D Func_48572_a(int par1, int par2, int par3)
        {
            for (int i = 0; i < 10; i++)
            {
                int j = (par1 + Field_48582_a.Rand.Next(16)) - 8;
                int k = (par2 + Field_48582_a.Rand.Next(6)) - 3;
                int l = (par3 + Field_48582_a.Rand.Next(16)) - 8;

                if (Field_48576_f.IsInRange(j, k, l) && SpawnerAnimals.CanCreatureTypeSpawnAtLocation(CreatureType.Monster, Field_48582_a, j, k, l))
                {
                    return(Vec3D.CreateVector(j, k, l));
                }
            }

            return(null);
        }
        ///<summary>
        /// Populates chunk with ores etc etc
        ///</summary>
        public void Populate(IChunkProvider par1IChunkProvider, int par2, int par3)
        {
            BlockSand.FallInstantly = true;
            int          i            = par2 * 16;
            int          j            = par3 * 16;
            BiomeGenBase biomegenbase = worldObj.GetBiomeGenForCoords(i + 16, j + 16);

            rand.SetSeed((int)worldObj.GetSeed());
            long l  = (rand.Next() / 2L) * 2L + 1L;
            long l1 = (rand.Next() / 2L) * 2L + 1L;

            rand.SetSeed(par2 * (int)l + par3 * (int)l1 ^ (int)worldObj.GetSeed());
            bool flag = false;

            if (mapFeaturesEnabled)
            {
                mineshaftGenerator.GenerateStructuresInChunk(worldObj, rand, par2, par3);
                flag = villageGenerator.GenerateStructuresInChunk(worldObj, rand, par2, par3);
                strongholdGenerator.GenerateStructuresInChunk(worldObj, rand, par2, par3);
            }

            if (!flag && rand.Next(4) == 0)
            {
                int k  = i + rand.Next(16) + 8;
                int i2 = rand.Next(128);
                int i3 = j + rand.Next(16) + 8;
                (new WorldGenLakes(Block.WaterStill.BlockID)).Generate(worldObj, rand, k, i2, i3);
            }

            if (!flag && rand.Next(8) == 0)
            {
                int i1 = i + rand.Next(16) + 8;
                int j2 = rand.Next(rand.Next(120) + 8);
                int j3 = j + rand.Next(16) + 8;

                if (j2 < 63 || rand.Next(10) == 0)
                {
                    (new WorldGenLakes(Block.LavaStill.BlockID)).Generate(worldObj, rand, i1, j2, j3);
                }
            }

            for (int j1 = 0; j1 < 8; j1++)
            {
                int k2 = i + rand.Next(16) + 8;
                int k3 = rand.Next(128);
                int i4 = j + rand.Next(16) + 8;

                if (!(new WorldGenDungeons()).Generate(worldObj, rand, k2, k3, i4))
                {
                    ;
                }
            }

            biomegenbase.Decorate(worldObj, rand, i, j);
            SpawnerAnimals.PerformWorldGenSpawning(worldObj, biomegenbase, i + 8, j + 8, 16, 16, rand);
            i += 8;
            j += 8;

            for (int k1 = 0; k1 < 16; k1++)
            {
                for (int l2 = 0; l2 < 16; l2++)
                {
                    int l3 = worldObj.GetPrecipitationHeight(i + k1, j + l2);

                    if (worldObj.IsBlockHydratedDirectly(k1 + i, l3 - 1, l2 + j))
                    {
                        worldObj.SetBlockWithNotify(k1 + i, l3 - 1, l2 + j, Block.Ice.BlockID);
                    }

                    if (worldObj.CanSnowAt(k1 + i, l3, l2 + j))
                    {
                        worldObj.SetBlockWithNotify(k1 + i, l3, l2 + j, Block.Snow.BlockID);
                    }
                }
            }

            BlockSand.FallInstantly = false;
        }