]> git.lizzy.rs Git - minetest.git/blobdiff - src/mapgen_v6.cpp
Particles: Do not add digging particles for airlike nodes (#6392)
[minetest.git] / src / mapgen_v6.cpp
index ec33fee08413972332a24d88b09ab73e161c2b04..cd337b380f7f087fcc771794850d240ab81f782c 100644 (file)
@@ -145,19 +145,19 @@ MapgenV6::~MapgenV6()
 }
 
 
-MapgenV6Params::MapgenV6Params()
+MapgenV6Params::MapgenV6Params():
+       np_terrain_base   (-4,   20.0, v3f(250.0, 250.0, 250.0), 82341,  5, 0.6,  2.0),
+       np_terrain_higher (20,   16.0, v3f(500.0, 500.0, 500.0), 85039,  5, 0.6,  2.0),
+       np_steepness      (0.85, 0.5,  v3f(125.0, 125.0, 125.0), -932,   5, 0.7,  2.0),
+       np_height_select  (0,    1.0,  v3f(250.0, 250.0, 250.0), 4213,   5, 0.69, 2.0),
+       np_mud            (4,    2.0,  v3f(200.0, 200.0, 200.0), 91013,  3, 0.55, 2.0),
+       np_beach          (0,    1.0,  v3f(250.0, 250.0, 250.0), 59420,  3, 0.50, 2.0),
+       np_biome          (0,    1.0,  v3f(500.0, 500.0, 500.0), 9130,   3, 0.50, 2.0),
+       np_cave           (6,    6.0,  v3f(250.0, 250.0, 250.0), 34329,  3, 0.50, 2.0),
+       np_humidity       (0.5,  0.5,  v3f(500.0, 500.0, 500.0), 72384,  3, 0.50, 2.0),
+       np_trees          (0,    1.0,  v3f(125.0, 125.0, 125.0), 2,      4, 0.66, 2.0),
+       np_apple_trees    (0,    1.0,  v3f(100.0, 100.0, 100.0), 342902, 3, 0.45, 2.0)
 {
-       np_terrain_base   = NoiseParams(-4,   20.0, v3f(250.0, 250.0, 250.0), 82341,  5, 0.6,  2.0);
-       np_terrain_higher = NoiseParams(20,   16.0, v3f(500.0, 500.0, 500.0), 85039,  5, 0.6,  2.0);
-       np_steepness      = NoiseParams(0.85, 0.5,  v3f(125.0, 125.0, 125.0), -932,   5, 0.7,  2.0);
-       np_height_select  = NoiseParams(0,    1.0,  v3f(250.0, 250.0, 250.0), 4213,   5, 0.69, 2.0);
-       np_mud            = NoiseParams(4,    2.0,  v3f(200.0, 200.0, 200.0), 91013,  3, 0.55, 2.0);
-       np_beach          = NoiseParams(0,    1.0,  v3f(250.0, 250.0, 250.0), 59420,  3, 0.50, 2.0);
-       np_biome          = NoiseParams(0,    1.0,  v3f(500.0, 500.0, 500.0), 9130,   3, 0.50, 2.0);
-       np_cave           = NoiseParams(6,    6.0,  v3f(250.0, 250.0, 250.0), 34329,  3, 0.50, 2.0);
-       np_humidity       = NoiseParams(0.5,  0.5,  v3f(500.0, 500.0, 500.0), 72384,  3, 0.50, 2.0);
-       np_trees          = NoiseParams(0,    1.0,  v3f(125.0, 125.0, 125.0), 2,      4, 0.66, 2.0);
-       np_apple_trees    = NoiseParams(0,    1.0,  v3f(100.0, 100.0, 100.0), 342902, 3, 0.45, 2.0);
 }
 
 
@@ -455,19 +455,20 @@ BiomeV6Type MapgenV6::getBiome(int index, v2s16 p)
                }
 
                return BT_NORMAL;
-       } else {
-               if (d > freq_desert)
-                       return BT_DESERT;
+       }
 
-               if ((spflags & MGV6_BIOMEBLEND) && (d > freq_desert - 0.10) &&
-                               ((noise2d(p.X, p.Y, seed) + 1.0) > (freq_desert - d) * 20.0))
-                       return BT_DESERT;
+       if (d > freq_desert)
+               return BT_DESERT;
 
-               if ((spflags & MGV6_JUNGLES) && h > 0.75)
-                       return BT_JUNGLE;
+       if ((spflags & MGV6_BIOMEBLEND) && (d > freq_desert - 0.10) &&
+                       ((noise2d(p.X, p.Y, seed) + 1.0) > (freq_desert - d) * 20.0))
+               return BT_DESERT;
+
+       if ((spflags & MGV6_JUNGLES) && h > 0.75)
+               return BT_JUNGLE;
+
+       return BT_NORMAL;
 
-               return BT_NORMAL;
-       }
 }
 
 
@@ -511,13 +512,6 @@ void MapgenV6::makeChunk(BlockMakeData *data)
        central_area_size = node_max - node_min + v3s16(1, 1, 1);
        assert(central_area_size.X == central_area_size.Z);
 
-       int volume_blocks = (blockpos_max.X - blockpos_min.X + 1)
-                                         * (blockpos_max.Y - blockpos_min.Y + 1)
-                                         * (blockpos_max.Z - blockpos_max.Z + 1);
-
-       volume_nodes = volume_blocks *
-               MAP_BLOCKSIZE * MAP_BLOCKSIZE * MAP_BLOCKSIZE;
-
        // Create a block-specific seed
        blockseed = get_blockseed(data->seed, full_node_min);