Beispiel #1
0
        public override void Decorate(ChunkColumn chunk, BiomeBase biome)
        {
            /*	var trees = ExperimentalV2Generator.GetRandomNumber(3, 8);
            var treeBasePositions = new int[trees, 2];

            for (var t = 0; t < trees; t++)
            {
                var x = ExperimentalV2Generator.GetRandomNumber(1, 16);
                var z = ExperimentalV2Generator.GetRandomNumber(1, 16);
                treeBasePositions[t, 0] = x;
                treeBasePositions[t, 1] = z;
            }
            for (int y = ExperimentalV2Generator.WaterLevel; y < 256; y++)
            {
                for (var pos = 0; pos < trees; pos++)
                {
                    if (chunk.GetBlock(treeBasePositions[pos, 0], y, treeBasePositions[pos, 1]) == biome.TopBlock.Id)
                    {
                            var meta = ExperimentalV2Generator.GetRandomNumber(0, 8);
                            chunk.SetBlock(treeBasePositions[pos, 0], y + 1, treeBasePositions[pos, 1],
                                new Block(38) {Metadata = (ushort) meta});
                    }
                }
            }*/
        }
Beispiel #2
0
        private void DecorateTrees(ChunkColumn chunk, BiomeBase biome)
        {
            var trees = StandardWorldProvider.GetRandomNumber(biome.MinTrees, biome.MaxTrees);
            var treeBasePositions = new int[trees, 2];

            for (var t = 0; t < trees; t++)
            {
                var x = new Random().Next(1, 16);
                var z = new Random().Next(1, 16);
                treeBasePositions[t, 0] = x;
                treeBasePositions[t, 1] = z;
            }

            for (var y = StandardWorldProvider.WaterLevel + 2; y < 256; y++)
            {
                for (var pos = 0; pos < trees; pos++)
                {
                    if (treeBasePositions[pos, 0] < 14 && treeBasePositions[pos, 0] > 4 && treeBasePositions[pos, 1] < 14 &&
                        treeBasePositions[pos, 1] > 4)
                    {
                        if (chunk.GetBlock(treeBasePositions[pos, 0], y + 1, treeBasePositions[pos, 1]) == biome.TopBlock.Id)
                        {
                            GenerateTree(chunk, treeBasePositions[pos, 0], y + 1, treeBasePositions[pos, 1], biome);
                        }
                    }
                }
            }
        }
Beispiel #3
0
 public override void Decorate(ChunkColumn chunk, BiomeBase biome)
 {
     for (var x = 0; x < 16; x++)
     {
         for (var z = 0; z < 16; z++)
         {
             //Check for temperature.
             for (var y = 0; y < StandardWorldProvider.WaterLevel; y++)
             {
                 //Lake generation
                 if (y < StandardWorldProvider.WaterLevel)
                 {
                     if (chunk.GetBlock(x, y, z) == 2 || chunk.GetBlock(x, y, z) == 3) //Grass or Dirt?
                     {
                         if (StandardWorldProvider.GetRandomNumber(1, 40) == 1 && y < StandardWorldProvider.WaterLevel - 4)
                             chunk.SetBlock(x, y, z, BlockFactory.GetBlockById(82)); //Clay
                         else
                         {
                             chunk.SetBlock(x, y, z, new BlockSand()); //Sand
                             chunk.BiomeId[x*16 + z] = 16; //Beach
                         }
                     }
                     if (chunk.GetBlock(x, y + 1, z) == 0)
                     {
                         if (y < StandardWorldProvider.WaterLevel - 3)
                         {
                             chunk.SetBlock(x, y + 1, z, new BlockFlowingWater()); //Water
                             chunk.BiomeId[x*16 + z] = 0; //Ocean
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #4
0
 private void GenerateTree(ChunkColumn chunk, int x, int treebase, int z, BiomeBase biome)
 {
     if (biome.TreeStructures.Length > 0)
     {
         var value = StandardWorldProvider.GetRandomNumber(0, biome.TreeStructures.Length);
         biome.TreeStructures[value].Create(chunk, x, treebase, z);
     }
 }
Beispiel #5
0
 public override void Decorate(ChunkColumn chunk, BiomeBase biome, int x, int z)
 {
     for (var y = 1; y < 6; y++)
     {
         if (StandardWorldProvider.GetRandomNumber(0, 5) == 1)
         {
             chunk.SetBlock(x, y, z, BlockFactory.GetBlockById(7));
         }
     }
 }
Beispiel #6
0
 public override void Decorate(ChunkColumn chunk, BiomeBase biome, int x, int z)
 {
     for (var y = StandardWorldProvider.WaterLevel; y < 256; y++)
     {
         if (StandardWorldProvider.GetRandomNumber(0, 10) == 5)
         {
             if (chunk.GetBlock(x, y, z) == biome.TopBlock.Id)
             {
                 chunk.SetBlock(x, y + 1, z, new Block(31) {Metadata = 1});
             }
         }
     }
 }
Beispiel #7
0
 public override void Decorate(ChunkColumn chunk, BiomeBase biome, int x, int z)
 {
     if (x < 15 && x > 3 && z < 15 && z > 3)
     {
         for (var y = StandardWorldProvider.WaterLevel; y < 256; y++)
         {
             if (StandardWorldProvider.GetRandomNumber(0, 30) == 5)
             {
                 if (chunk.GetBlock(x, y + 1, z) == biome.TopBlock.Id)
                 {
                     GenerateTree(chunk, x, y + 1, z, biome);
                 }
             }
         }
     }
 }
Beispiel #8
0
        public override void Decorate(ChunkColumn chunk, BiomeBase biome, int x, int z)
        {
            _chunke = chunk;
            for (var y = 1 /*No need to check first layer :p*/; y < 128 /*Nothing above this*/; y++)
            {
                if (chunk.GetBlock(x, y, z) == 1)
                {
                    if (y < 128)
                    {
                        GenerateCoal(x, y, z);
                    }

                    if (y < 64)
                    {
                        GenerateIron(x, y, z);
                    }

                    if (y < 29)
                    {
                        GenerateGold(x, y, z);
                    }

                    if (y < 23)
                    {
                        GenerateLapis(x, y, z);
                    }

                    if (y < 16)
                    {
                        if (y > 12)
                        {
                            if (StandardWorldProvider.GetRandomNumber(0, 3) == 2)
                            {
                                GenerateDiamond(x, y, z);
                            }
                        }
                        else
                        {
                            GenerateDiamond(x, y, z);
                        }
                    }
                }
            }
        }
Beispiel #9
0
 public override void Decorate(ChunkColumn chunk, BiomeBase biome)
 {
     for (var x = 0; x < 16; x++)
     {
         for (var z = 0; z < 16; z++)
         {
             for (var y = 0; y < LavaLevel; y++)
             {
                 //Lake generation
                 if (y < LavaLevel)
                 {
                     if (chunk.GetBlock(x, y + 1, z) == 0)
                     {
                         chunk.SetBlock(x, y + 1, z, BlockFactory.GetBlockById(10)); //Lava
                     }
                 }
             }
         }
     }
 }
Beispiel #10
0
 private void DecorateTrees(ChunkColumn chunk, BiomeBase biome)
 {
     for (var x = 0; x < 16; x++)
     {
         for (var z = 0; z < 16; z++)
         {
             for (var y = StandardWorldProvider.WaterLevel; y < 256; y++)
             {
                 if (StandardWorldProvider.GetRandomNumber(0, 13) == 5)
                 {
                     //The if is so we don't have 'f****d up' trees xD
                     if (x < 15 && x > 3 && z < 15 && z > 3)
                     {
                         if (chunk.GetBlock(x, y + 1, z) == biome.TopBlock.Id)
                         {
                             GenerateTree(chunk, x, y + 1, z, biome);
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #11
0
 public override void Decorate(ChunkColumn chunk, BiomeBase biome)
 {
     for (var x = 0; x < 16; x++)
     {
         for (var z = 0; z < 16; z++)
         {
             //Check for temperature.
             for (var y = 0; y < NetherWorldProvider.WaterLevel; y++)
             {
                 //Lake generation
                 if (y < NetherWorldProvider.WaterLevel)
                 {
                     if (chunk.GetBlock(x, y + 1, z) == 0)
                     {
                         if (y < NetherWorldProvider.WaterLevel - 3)
                         {
                             chunk.SetBlock(x, y + 1, z, new BlockStationaryLava()); //Water
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #12
0
 public override void Decorate(ChunkColumn chunk, BiomeBase biome)
 {
 }
Beispiel #13
0
 public void AddBiomeType(BiomeBase biome)
 {
     Biomes.Add(biome);
 }
Beispiel #14
0
 public virtual void Decorate(ChunkColumn chunk, BiomeBase biome, int x, int z)
 {
     Decorate(chunk, biome);
 }
Beispiel #15
0
 public virtual void Decorate(ChunkColumn chunk, BiomeBase biome)
 {
 }
Beispiel #16
0
 public void AddBiomeType(BiomeBase biome)
 {
     Biomes.Add(biome);
 }