Mapgen: Use decoration sidelen 16 for jungletrees and junglegrass
[oweals/minetest_game.git] / mods / default / mapgen.lua
index 9f96cc35ebeb58dd9c8df8191bcb493b83e6d187..0fabb2ed09b32a70c1bc6ba4e538fa856dcfdde7 100644 (file)
@@ -1,8 +1,7 @@
 --
--- Aliases for map generator outputs
+-- Aliases for map generators
 --
 
-minetest.register_alias("mapgen_air", "air")
 minetest.register_alias("mapgen_stone", "default:stone")
 minetest.register_alias("mapgen_dirt", "default:dirt")
 minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
@@ -35,22 +34,26 @@ minetest.register_alias("mapgen_pine_needles", "default:pine_needles")
 minetest.register_alias("mapgen_cobble", "default:cobble")
 minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
 minetest.register_alias("mapgen_mossycobble", "default:mossycobble")
+minetest.register_alias("mapgen_stair_desert_stone", "stairs:stair_desert_stone")
 minetest.register_alias("mapgen_sandstonebrick", "default:sandstonebrick")
-minetest.register_alias("mapgen_stair_sandstonebrick", "stairs:stair_sandstonebrick")
+minetest.register_alias("mapgen_stair_sandstone_block", "stairs:stair_sandstone_block")
 
 
 --
 -- Register ores
 --
 
--- All mapgens except singlenode
--- Blob ore first to avoid other ores inside blobs
+-- Blob ores
+-- These first to avoid other ores in blobs
 
-function default.register_ores()
+-- Mgv6
+
+function default.register_mgv6_blob_ores()
 
        -- Clay
+       -- This first to avoid clay in sand blobs
 
-       minetest.register_ore({ 
+       minetest.register_ore({
                ore_type        = "blob",
                ore             = "default:clay",
                wherein         = {"default:sand"},
@@ -71,15 +74,104 @@ function default.register_ores()
 
        -- Sand
 
-       minetest.register_ore({ 
+       minetest.register_ore({
                ore_type        = "blob",
                ore             = "default:sand",
-               wherein         = {"default:stone", "default:sandstone",
-                       "default:desert_stone"},
+               wherein         = {"default:stone", "default:desert_stone"},
+               clust_scarcity  = 16 * 16 * 16,
+               clust_size      = 5,
+               y_min           = -31,
+               y_max           = 0,
+               noise_threshold = 0.0,
+               noise_params    = {
+                       offset = 0.5,
+                       scale = 0.2,
+                       spread = {x = 5, y = 5, z = 5},
+                       seed = 2316,
+                       octaves = 1,
+                       persist = 0.0
+               },
+       })
+
+       -- Dirt
+
+       minetest.register_ore({
+               ore_type        = "blob",
+               ore             = "default:dirt",
+               wherein         = {"default:stone"},
                clust_scarcity  = 16 * 16 * 16,
                clust_size      = 5,
                y_min           = -31,
-               y_max           = 4,
+               y_max           = 31000,
+               noise_threshold = 0.0,
+               noise_params    = {
+                       offset = 0.5,
+                       scale = 0.2,
+                       spread = {x = 5, y = 5, z = 5},
+                       seed = 17676,
+                       octaves = 1,
+                       persist = 0.0
+               },
+       })
+
+       -- Gravel
+
+       minetest.register_ore({
+               ore_type        = "blob",
+               ore             = "default:gravel",
+               wherein         = {"default:stone"},
+               clust_scarcity  = 16 * 16 * 16,
+               clust_size      = 5,
+               y_min           = -31000,
+               y_max           = 31000,
+               noise_threshold = 0.0,
+               noise_params    = {
+                       offset = 0.5,
+                       scale = 0.2,
+                       spread = {x = 5, y = 5, z = 5},
+                       seed = 766,
+                       octaves = 1,
+                       persist = 0.0
+               },
+       })
+end
+
+
+-- All mapgens except mgv6
+
+function default.register_blob_ores()
+
+       -- Clay
+
+       minetest.register_ore({
+               ore_type        = "blob",
+               ore             = "default:clay",
+               wherein         = {"default:sand"},
+               clust_scarcity  = 16 * 16 * 16,
+               clust_size      = 5,
+               y_min           = -15,
+               y_max           = 0,
+               noise_threshold = 0.0,
+               noise_params    = {
+                       offset = 0.5,
+                       scale = 0.2,
+                       spread = {x = 5, y = 5, z = 5},
+                       seed = -316,
+                       octaves = 1,
+                       persist = 0.0
+               },
+       })
+
+       -- Silver sand
+
+       minetest.register_ore({
+               ore_type        = "blob",
+               ore             = "default:silver_sand",
+               wherein         = {"default:stone"},
+               clust_scarcity  = 16 * 16 * 16,
+               clust_size      = 5,
+               y_min           = -31000,
+               y_max           = 31000,
                noise_threshold = 0.0,
                noise_params    = {
                        offset = 0.5,
@@ -89,6 +181,13 @@ function default.register_ores()
                        octaves = 1,
                        persist = 0.0
                },
+               biomes = {"icesheet_ocean", "tundra", "tundra_beach", "tundra_ocean",
+                       "taiga", "taiga_ocean", "snowy_grassland", "snowy_grassland_ocean",
+                       "grassland", "grassland_dunes", "grassland_ocean", "coniferous_forest",
+                       "coniferous_forest_dunes", "coniferous_forest_ocean", "deciduous_forest",
+                       "deciduous_forest_shore", "deciduous_forest_ocean", "cold_desert",
+                       "cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean",
+                       "rainforest", "rainforest_swamp", "rainforest_ocean", "underground"}
        })
 
        -- Dirt
@@ -96,7 +195,7 @@ function default.register_ores()
        minetest.register_ore({
                ore_type        = "blob",
                ore             = "default:dirt",
-               wherein         = {"default:stone", "default:sandstone"},
+               wherein         = {"default:stone"},
                clust_scarcity  = 16 * 16 * 16,
                clust_size      = 5,
                y_min           = -31,
@@ -110,6 +209,9 @@ function default.register_ores()
                        octaves = 1,
                        persist = 0.0
                },
+               biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest",
+                       "deciduous_forest", "deciduous_forest_shore", "savanna", "savanna_shore",
+                       "rainforest", "rainforest_swamp"}
        })
 
        -- Gravel
@@ -131,10 +233,35 @@ function default.register_ores()
                        octaves = 1,
                        persist = 0.0
                },
+               biomes = {"icesheet_ocean", "tundra", "tundra_beach", "tundra_ocean",
+                       "taiga", "taiga_ocean", "snowy_grassland", "snowy_grassland_ocean",
+                       "grassland", "grassland_dunes", "grassland_ocean", "coniferous_forest",
+                       "coniferous_forest_dunes", "coniferous_forest_ocean", "deciduous_forest",
+                       "deciduous_forest_shore", "deciduous_forest_ocean", "cold_desert",
+                       "cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean",
+                       "rainforest", "rainforest_swamp", "rainforest_ocean", "underground"}
        })
+end
+
+
+-- Scatter ores
+-- All mapgens
+
+function default.register_ores()
 
        -- Coal
 
+       minetest.register_ore({
+               ore_type       = "scatter",
+               ore            = "default:stone_with_coal",
+               wherein        = "default:stone",
+               clust_scarcity = 8 * 8 * 8,
+               clust_num_ores = 9,
+               clust_size     = 3,
+               y_min          = 1025,
+               y_max          = 31000,
+       })
+
        minetest.register_ore({
                ore_type       = "scatter",
                ore            = "default:stone_with_coal",
@@ -163,53 +290,88 @@ function default.register_ores()
                ore_type       = "scatter",
                ore            = "default:stone_with_iron",
                wherein        = "default:stone",
-               clust_scarcity = 12 * 12 * 12,
-               clust_num_ores = 3,
-               clust_size     = 2,
-               y_min          = -15,
-               y_max          = 2,
+               clust_scarcity = 9 * 9 * 9,
+               clust_num_ores = 12,
+               clust_size     = 3,
+               y_min          = 1025,
+               y_max          = 31000,
        })
 
        minetest.register_ore({
                ore_type       = "scatter",
                ore            = "default:stone_with_iron",
                wherein        = "default:stone",
+               clust_scarcity = 7 * 7 * 7,
+               clust_num_ores = 5,
+               clust_size     = 3,
+               y_min          = -31000,
+               y_max          = 0,
+       })
+
+       minetest.register_ore({
+               ore_type       = "scatter",
+               ore            = "default:stone_with_iron",
+               wherein        = "default:stone",
+               clust_scarcity = 24 * 24 * 24,
+               clust_num_ores = 27,
+               clust_size     = 6,
+               y_min          = -31000,
+               y_max          = -64,
+       })
+
+       -- Copper
+
+       minetest.register_ore({
+               ore_type       = "scatter",
+               ore            = "default:stone_with_copper",
+               wherein        = "default:stone",
                clust_scarcity = 9 * 9 * 9,
                clust_num_ores = 5,
                clust_size     = 3,
+               y_min          = 1025,
+               y_max          = 31000,
+       })
+
+       minetest.register_ore({
+               ore_type       = "scatter",
+               ore            = "default:stone_with_copper",
+               wherein        = "default:stone",
+               clust_scarcity = 12 * 12 * 12,
+               clust_num_ores = 4,
+               clust_size     = 3,
                y_min          = -63,
                y_max          = -16,
        })
 
        minetest.register_ore({
                ore_type       = "scatter",
-               ore            = "default:stone_with_iron",
+               ore            = "default:stone_with_copper",
                wherein        = "default:stone",
-               clust_scarcity = 7 * 7 * 7,
+               clust_scarcity = 9 * 9 * 9,
                clust_num_ores = 5,
                clust_size     = 3,
                y_min          = -31000,
                y_max          = -64,
        })
 
+       -- Gold
+
        minetest.register_ore({
                ore_type       = "scatter",
-               ore            = "default:stone_with_iron",
+               ore            = "default:stone_with_gold",
                wherein        = "default:stone",
-               clust_scarcity = 24 * 24 * 24,
-               clust_num_ores = 27,
-               clust_size     = 6,
-               y_min          = -31000,
-               y_max          = -64,
+               clust_scarcity = 13 * 13 * 13,
+               clust_num_ores = 5,
+               clust_size     = 3,
+               y_min          = 1025,
+               y_max          = 31000,
        })
 
-       --Mese
-
        minetest.register_ore({
                ore_type       = "scatter",
-               ore            = "default:stone_with_mese",
+               ore            = "default:stone_with_gold",
                wherein        = "default:stone",
-               clust_scarcity = 18 * 18 * 18,
+               clust_scarcity = 15 * 15 * 15,
                clust_num_ores = 3,
                clust_size     = 2,
                y_min          = -255,
@@ -218,33 +380,33 @@ function default.register_ores()
 
        minetest.register_ore({
                ore_type       = "scatter",
-               ore            = "default:stone_with_mese",
+               ore            = "default:stone_with_gold",
                wherein        = "default:stone",
-               clust_scarcity = 14 * 14 * 14,
+               clust_scarcity = 13 * 13 * 13,
                clust_num_ores = 5,
                clust_size     = 3,
                y_min          = -31000,
                y_max          = -256,
        })
 
+       -- Mese crystal
+
        minetest.register_ore({
                ore_type       = "scatter",
-               ore            = "default:mese",
+               ore            = "default:stone_with_mese",
                wherein        = "default:stone",
-               clust_scarcity = 36 * 36 * 36,
-               clust_num_ores = 3,
-               clust_size     = 2,
-               y_min          = -31000,
-               y_max          = -1024,
+               clust_scarcity = 14 * 14 * 14,
+               clust_num_ores = 5,
+               clust_size     = 3,
+               y_min          = 1025,
+               y_max          = 31000,
        })
 
-       -- Gold
-
        minetest.register_ore({
                ore_type       = "scatter",
-               ore            = "default:stone_with_gold",
+               ore            = "default:stone_with_mese",
                wherein        = "default:stone",
-               clust_scarcity = 15 * 15 * 15,
+               clust_scarcity = 18 * 18 * 18,
                clust_num_ores = 3,
                clust_size     = 2,
                y_min          = -255,
@@ -253,9 +415,9 @@ function default.register_ores()
 
        minetest.register_ore({
                ore_type       = "scatter",
-               ore            = "default:stone_with_gold",
+               ore            = "default:stone_with_mese",
                wherein        = "default:stone",
-               clust_scarcity = 13 * 13 * 13,
+               clust_scarcity = 14 * 14 * 14,
                clust_num_ores = 5,
                clust_size     = 3,
                y_min          = -31000,
@@ -264,6 +426,17 @@ function default.register_ores()
 
        -- Diamond
 
+       minetest.register_ore({
+               ore_type       = "scatter",
+               ore            = "default:stone_with_diamond",
+               wherein        = "default:stone",
+               clust_scarcity = 15 * 15 * 15,
+               clust_num_ores = 4,
+               clust_size     = 3,
+               y_min          = 1025,
+               y_max          = 31000,
+       })
+
        minetest.register_ore({
                ore_type       = "scatter",
                ore            = "default:stone_with_diamond",
@@ -286,28 +459,28 @@ function default.register_ores()
                y_max          = -256,
        })
 
-       -- Copper
+       -- Mese block
 
        minetest.register_ore({
                ore_type       = "scatter",
-               ore            = "default:stone_with_copper",
+               ore            = "default:mese",
                wherein        = "default:stone",
-               clust_scarcity = 12 * 12 * 12,
-               clust_num_ores = 4,
-               clust_size     = 3,
-               y_min          = -63,
-               y_max          = -16,
+               clust_scarcity = 36 * 36 * 36,
+               clust_num_ores = 3,
+               clust_size     = 2,
+               y_min          = 1025,
+               y_max          = 31000,
        })
 
        minetest.register_ore({
                ore_type       = "scatter",
-               ore            = "default:stone_with_copper",
+               ore            = "default:mese",
                wherein        = "default:stone",
-               clust_scarcity = 9 * 9 * 9,
-               clust_num_ores = 5,
-               clust_size     = 3,
+               clust_scarcity = 36 * 36 * 36,
+               clust_num_ores = 3,
+               clust_size     = 2,
                y_min          = -31000,
-               y_max          = -64,
+               y_max          = -1024,
        })
 end
 
@@ -316,15 +489,14 @@ end
 -- Register biomes
 --
 
--- All mapgens except mgv6 and singlenode
+-- All mapgens except mgv6
 
 function default.register_biomes()
-       minetest.clear_registered_biomes()
 
-       -- Permanent ice
+       -- Icesheet
 
        minetest.register_biome({
-               name = "glacier",
+               name = "icesheet",
                node_dust = "default:snowblock",
                node_top = "default:snowblock",
                depth_top = 1,
@@ -335,48 +507,72 @@ function default.register_biomes()
                depth_water_top = 10,
                --node_water = "",
                node_river_water = "default:ice",
+               node_riverbed = "default:gravel",
+               depth_riverbed = 2,
                y_min = -8,
                y_max = 31000,
                heat_point = 0,
-               humidity_point = 50,
+               humidity_point = 73,
        })
 
        minetest.register_biome({
-               name = "glacier_ocean",
+               name = "icesheet_ocean",
                node_dust = "default:snowblock",
                node_top = "default:sand",
                depth_top = 1,
                node_filler = "default:sand",
                depth_filler = 3,
                --node_stone = "",
-               --node_water_top = "",
-               --depth_water_top = ,
+               node_water_top = "default:ice",
+               depth_water_top = 10,
                --node_water = "",
                --node_river_water = "",
                y_min = -112,
                y_max = -9,
                heat_point = 0,
-               humidity_point = 50,
+               humidity_point = 73,
        })
 
-       -- Cold
+       -- Tundra
 
        minetest.register_biome({
                name = "tundra",
-               --node_dust = "",
-               node_top = "default:dirt_with_snow",
-               depth_top = 1,
-               node_filler = "default:dirt",
-               depth_filler = 1,
+               node_dust = "default:snowblock",
+               --node_top = ,
+               --depth_top = ,
+               --node_filler = ,
+               --depth_filler = ,
                --node_stone = "",
                --node_water_top = "",
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:gravel",
+               depth_riverbed = 2,
                y_min = 2,
                y_max = 31000,
-               heat_point = 15,
-               humidity_point = 35,
+               heat_point = 0,
+               humidity_point = 40,
+       })
+
+       minetest.register_biome({
+               name = "tundra_beach",
+               --node_dust = "",
+               node_top = "default:gravel",
+               depth_top = 1,
+               node_filler = "default:gravel",
+               depth_filler = 2,
+               --node_stone = "",
+               --node_water_top = "",
+               --depth_water_top = ,
+               --node_water = "",
+               --node_river_water = "",
+               node_riverbed = "default:gravel",
+               depth_riverbed = 2,
+               y_min = -3,
+               y_max = 1,
+               heat_point = 0,
+               humidity_point = 40,
        })
 
        minetest.register_biome({
@@ -391,12 +587,15 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:gravel",
+               depth_riverbed = 2,
                y_min = -112,
-               y_max = 1,
-               heat_point = 15,
-               humidity_point = 35,
+               y_max = -4,
+               heat_point = 0,
+               humidity_point = 40,
        })
 
+       -- Taiga
 
        minetest.register_biome({
                name = "taiga",
@@ -410,10 +609,12 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = 2,
                y_max = 31000,
-               heat_point = 15,
-               humidity_point = 65,
+               heat_point = 25,
+               humidity_point = 70,
        })
 
        minetest.register_biome({
@@ -428,16 +629,60 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = -112,
                y_max = 1,
-               heat_point = 15,
-               humidity_point = 65,
+               heat_point = 25,
+               humidity_point = 70,
        })
 
-       -- Temperate
+       -- Snowy grassland
 
        minetest.register_biome({
-               name = "stone_grassland",
+               name = "snowy_grassland",
+               node_dust = "default:snow",
+               node_top = "default:dirt_with_snow",
+               depth_top = 1,
+               node_filler = "default:dirt",
+               depth_filler = 1,
+               --node_stone = "",
+               --node_water_top = "",
+               --depth_water_top = ,
+               --node_water = "",
+               --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
+               y_min = 5,
+               y_max = 31000,
+               heat_point = 20,
+               humidity_point = 35,
+       })
+
+       minetest.register_biome({
+               name = "snowy_grassland_ocean",
+               --node_dust = "",
+               node_top = "default:sand",
+               depth_top = 1,
+               node_filler = "default:sand",
+               depth_filler = 3,
+               --node_stone = "",
+               --node_water_top = "",
+               --depth_water_top = ,
+               --node_water = "",
+               --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
+               y_min = -112,
+               y_max = 4,
+               heat_point = 20,
+               humidity_point = 35,
+       })
+
+       -- Grassland
+
+       minetest.register_biome({
+               name = "grassland",
                --node_dust = "",
                node_top = "default:dirt_with_grass",
                depth_top = 1,
@@ -448,14 +693,16 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = 6,
                y_max = 31000,
-               heat_point = 40,
+               heat_point = 50,
                humidity_point = 35,
        })
 
        minetest.register_biome({
-               name = "stone_grassland_dunes",
+               name = "grassland_dunes",
                --node_dust = "",
                node_top = "default:sand",
                depth_top = 1,
@@ -466,14 +713,16 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = 5,
                y_max = 5,
-               heat_point = 40,
+               heat_point = 50,
                humidity_point = 35,
        })
 
        minetest.register_biome({
-               name = "stone_grassland_ocean",
+               name = "grassland_ocean",
                --node_dust = "",
                node_top = "default:sand",
                depth_top = 1,
@@ -484,12 +733,15 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = -112,
                y_max = 4,
-               heat_point = 40,
+               heat_point = 50,
                humidity_point = 35,
        })
 
+       -- Coniferous forest
 
        minetest.register_biome({
                name = "coniferous_forest",
@@ -503,10 +755,12 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = 6,
                y_max = 31000,
-               heat_point = 40,
-               humidity_point = 65,
+               heat_point = 45,
+               humidity_point = 70,
        })
 
        minetest.register_biome({
@@ -521,10 +775,12 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = 5,
-               y_max = 5,
-               heat_point = 40,
-               humidity_point = 65,
+               y_max = 5,
+               heat_point = 45,
+               humidity_point = 70,
        })
 
        minetest.register_biome({
@@ -539,160 +795,203 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = -112,
                y_max = 4,
-               heat_point = 40,
-               humidity_point = 65,
+               heat_point = 45,
+               humidity_point = 70,
        })
 
+       -- Deciduous forest
 
        minetest.register_biome({
-               name = "sandstone_grassland",
+               name = "deciduous_forest",
                --node_dust = "",
                node_top = "default:dirt_with_grass",
                depth_top = 1,
                node_filler = "default:dirt",
-               depth_filler = 1,
-               node_stone = "default:sandstone",
+               depth_filler = 3,
+               --node_stone = "",
                --node_water_top = "",
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
-               y_min = 6,
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
+               y_min = 1,
                y_max = 31000,
                heat_point = 60,
-               humidity_point = 35,
+               humidity_point = 68,
        })
 
        minetest.register_biome({
-               name = "sandstone_grassland_dunes",
+               name = "deciduous_forest_shore",
                --node_dust = "",
-               node_top = "default:sand",
+               node_top = "default:dirt",
                depth_top = 1,
-               node_filler = "default:sand",
-               depth_filler = 2,
-               node_stone = "default:sandstone",
+               node_filler = "default:dirt",
+               depth_filler = 3,
+               --node_stone = "",
                --node_water_top = "",
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
-               y_min = 5,
-               y_max = 5,
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
+               y_min = -1,
+               y_max = 0,
                heat_point = 60,
-               humidity_point = 35,
+               humidity_point = 68,
        })
 
        minetest.register_biome({
-               name = "sandstone_grassland_ocean",
+               name = "deciduous_forest_ocean",
                --node_dust = "",
                node_top = "default:sand",
                depth_top = 1,
                node_filler = "default:sand",
                depth_filler = 3,
-               node_stone = "default:sandstone",
+               --node_stone = "",
                --node_water_top = "",
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = -112,
-               y_max = 4,
+               y_max = -2,
                heat_point = 60,
-               humidity_point = 35,
+               humidity_point = 68,
        })
 
+       -- Desert
 
        minetest.register_biome({
-               name = "deciduous_forest",
+               name = "desert",
                --node_dust = "",
-               node_top = "default:dirt_with_grass",
+               node_top = "default:desert_sand",
                depth_top = 1,
-               node_filler = "default:dirt",
-               depth_filler = 3,
-               --node_stone = "",
+               node_filler = "default:desert_sand",
+               depth_filler = 1,
+               node_stone = "default:desert_stone",
                --node_water_top = "",
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
-               y_min = 1,
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
+               y_min = 5,
                y_max = 31000,
-               heat_point = 60,
-               humidity_point = 65,
+               heat_point = 92,
+               humidity_point = 16,
        })
 
        minetest.register_biome({
-               name = "deciduous_forest_swamp",
+               name = "desert_ocean",
                --node_dust = "",
-               node_top = "default:dirt",
+               node_top = "default:sand",
                depth_top = 1,
-               node_filler = "default:dirt",
+               node_filler = "default:sand",
                depth_filler = 3,
-               --node_stone = "",
+               node_stone = "default:desert_stone",
                --node_water_top = "",
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
-               y_min = -3,
-               y_max = 0,
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
+               y_min = -112,
+               y_max = 4,
+               heat_point = 92,
+               humidity_point = 16,
+       })
+
+       -- Sandstone desert
+
+       minetest.register_biome({
+               name = "sandstone_desert",
+               --node_dust = "",
+               node_top = "default:sand",
+               depth_top = 1,
+               node_filler = "default:sand",
+               depth_filler = 0,
+               node_stone = "default:sandstone",
+               --node_water_top = "",
+               --depth_water_top = ,
+               --node_water = "",
+               --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
+               y_min = 5,
+               y_max = 31000,
                heat_point = 60,
-               humidity_point = 65,
+               humidity_point = 0,
        })
 
        minetest.register_biome({
-               name = "deciduous_forest_ocean",
+               name = "sandstone_desert_ocean",
                --node_dust = "",
                node_top = "default:sand",
                depth_top = 1,
                node_filler = "default:sand",
                depth_filler = 3,
-               --node_stone = "",
+               node_stone = "default:sandstone",
                --node_water_top = "",
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = -112,
-               y_max = -4,
+               y_max = 4,
                heat_point = 60,
-               humidity_point = 65,
+               humidity_point = 0,
        })
 
-       -- Hot
+       -- Cold desert
 
        minetest.register_biome({
-               name = "desert",
+               name = "cold_desert",
                --node_dust = "",
-               node_top = "default:desert_sand",
+               node_top = "default:silver_sand",
                depth_top = 1,
-               node_filler = "default:desert_sand",
+               node_filler = "default:silver_sand",
                depth_filler = 1,
-               node_stone = "default:desert_stone",
+               --node_stone = "",
                --node_water_top = "",
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = 5,
                y_max = 31000,
-               heat_point = 85,
-               humidity_point = 20,
+               heat_point = 40,
+               humidity_point = 0,
        })
 
        minetest.register_biome({
-               name = "desert_ocean",
+               name = "cold_desert_ocean",
                --node_dust = "",
                node_top = "default:sand",
                depth_top = 1,
                node_filler = "default:sand",
                depth_filler = 3,
-               node_stone = "default:desert_stone",
+               --node_stone = "",
                --node_water_top = "",
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = -112,
                y_max = 4,
-               heat_point = 85,
-               humidity_point = 20,
+               heat_point = 40,
+               humidity_point = 0,
        })
 
+       -- Savanna
 
        minetest.register_biome({
                name = "savanna",
@@ -706,14 +1005,16 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = 1,
                y_max = 31000,
-               heat_point = 85,
-               humidity_point = 50,
+               heat_point = 89,
+               humidity_point = 42,
        })
 
        minetest.register_biome({
-               name = "savanna_swamp",
+               name = "savanna_shore",
                --node_dust = "",
                node_top = "default:dirt",
                depth_top = 1,
@@ -724,10 +1025,12 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
-               y_min = -3,
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
+               y_min = -1,
                y_max = 0,
-               heat_point = 85,
-               humidity_point = 50,
+               heat_point = 89,
+               humidity_point = 42,
        })
 
        minetest.register_biome({
@@ -742,17 +1045,20 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = -112,
-               y_max = -4,
-               heat_point = 85,
-               humidity_point = 50,
+               y_max = -2,
+               heat_point = 89,
+               humidity_point = 42,
        })
 
+       -- Rainforest
 
        minetest.register_biome({
                name = "rainforest",
                --node_dust = "",
-               node_top = "default:dirt_with_grass",
+               node_top = "default:dirt_with_rainforest_litter",
                depth_top = 1,
                node_filler = "default:dirt",
                depth_filler = 3,
@@ -761,10 +1067,12 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = 1,
                y_max = 31000,
-               heat_point = 85,
-               humidity_point = 80,
+               heat_point = 86,
+               humidity_point = 65,
        })
 
        minetest.register_biome({
@@ -779,10 +1087,12 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
-               y_min = -3,
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
+               y_min = -1,
                y_max = 0,
-               heat_point = 85,
-               humidity_point = 80,
+               heat_point = 86,
+               humidity_point = 65,
        })
 
        minetest.register_biome({
@@ -797,10 +1107,12 @@ function default.register_biomes()
                --depth_water_top = ,
                --node_water = "",
                --node_river_water = "",
+               node_riverbed = "default:sand",
+               depth_riverbed = 2,
                y_min = -112,
-               y_max = -4,
-               heat_point = 85,
-               humidity_point = 80,
+               y_max = -2,
+               heat_point = 86,
+               humidity_point = 65,
        })
 
        -- Underground
@@ -832,7 +1144,6 @@ end
 -- Mgv6
 
 function default.register_mgv6_decorations()
-       minetest.clear_registered_decorations()
 
        -- Papyrus
 
@@ -919,7 +1230,8 @@ function default.register_mgv6_decorations()
        })
 end
 
--- All mapgens except mgv6 and singlenode
+
+-- All mapgens except mgv6
 
 local function register_grass_decoration(offset, scale, length)
        minetest.register_decoration({
@@ -934,13 +1246,11 @@ local function register_grass_decoration(offset, scale, length)
                        octaves = 3,
                        persist = 0.6
                },
-               biomes = {"stone_grassland", "sandstone_grassland",
-                       "deciduous_forest", "coniferous_forest",
-                       "stone_grassland_dunes", "sandstone_grassland_dunes",
-                       "coniferous_forest_dunes"},
+               biomes = {"grassland", "grassland_dunes", "deciduous_forest",
+                       "coniferous_forest", "coniferous_forest_dunes"},
                y_min = 1,
                y_max = 31000,
-               decoration = "default:grass_"..length,
+               decoration = "default:grass_" .. length,
        })
 end
 
@@ -960,22 +1270,22 @@ local function register_dry_grass_decoration(offset, scale, length)
                biomes = {"savanna"},
                y_min = 1,
                y_max = 31000,
-               decoration = "default:dry_grass_"..length,
+               decoration = "default:dry_grass_" .. length,
        })
 end
 
+
 function default.register_decorations()
-       minetest.clear_registered_decorations()
 
-       -- Apple tree
+       -- Apple tree and log
 
        minetest.register_decoration({
                deco_type = "schematic",
                place_on = {"default:dirt_with_grass"},
                sidelen = 16,
                noise_params = {
-                       offset = 0.04,
-                       scale = 0.02,
+                       offset = 0.036,
+                       scale = 0.022,
                        spread = {x = 250, y = 250, z = 250},
                        seed = 2,
                        octaves = 3,
@@ -984,34 +1294,68 @@ function default.register_decorations()
                biomes = {"deciduous_forest"},
                y_min = 1,
                y_max = 31000,
-               schematic = minetest.get_modpath("default").."/schematics/apple_tree.mts",
+               schematic = minetest.get_modpath("default") .. "/schematics/apple_tree.mts",
                flags = "place_center_x, place_center_z",
+               rotation = "random",
+       })
+
+       minetest.register_decoration({
+               deco_type = "schematic",
+               place_on = {"default:dirt_with_grass"},
+               sidelen = 16,
+               noise_params = {
+                       offset = 0.0018,
+                       scale = 0.0011,
+                       spread = {x = 250, y = 250, z = 250},
+                       seed = 2,
+                       octaves = 3,
+                       persist = 0.66
+               },
+               biomes = {"deciduous_forest"},
+               y_min = 1,
+               y_max = 31000,
+               schematic = minetest.get_modpath("default") .. "/schematics/apple_log.mts",
+               flags = "place_center_x",
+               rotation = "random",
        })
 
-       -- Jungle tree
+       -- Jungle tree and log
 
        minetest.register_decoration({
                deco_type = "schematic",
-               place_on = {"default:dirt_with_grass", "default:dirt"},
-               sidelen = 80,
-               fill_ratio = 0.09,
+               place_on = {"default:dirt_with_rainforest_litter", "default:dirt"},
+               sidelen = 16,
+               fill_ratio = 0.1,
                biomes = {"rainforest", "rainforest_swamp"},
-               y_min = 0,
+               y_min = -1,
                y_max = 31000,
-               schematic = minetest.get_modpath("default").."/schematics/jungle_tree.mts",
+               schematic = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts",
                flags = "place_center_x, place_center_z",
                rotation = "random",
        })
 
-       -- Taiga and temperate coniferous forest pine tree
+       minetest.register_decoration({
+               deco_type = "schematic",
+               place_on = {"default:dirt_with_rainforest_litter", "default:dirt"},
+               sidelen = 16,
+               fill_ratio = 0.005,
+               biomes = {"rainforest", "rainforest_swamp"},
+               y_min = 1,
+               y_max = 31000,
+               schematic = minetest.get_modpath("default") .. "/schematics/jungle_log.mts",
+               flags = "place_center_x",
+               rotation = "random",
+       })
+
+       -- Taiga and temperate coniferous forest pine tree and log
 
        minetest.register_decoration({
                deco_type = "schematic",
                place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
                sidelen = 16,
                noise_params = {
-                       offset = 0.04,
-                       scale = 0.02,
+                       offset = 0.036,
+                       scale = 0.022,
                        spread = {x = 250, y = 250, z = 250},
                        seed = 2,
                        octaves = 3,
@@ -1020,11 +1364,31 @@ function default.register_decorations()
                biomes = {"taiga", "coniferous_forest"},
                y_min = 2,
                y_max = 31000,
-               schematic = minetest.get_modpath("default").."/schematics/pine_tree.mts",
+               schematic = minetest.get_modpath("default") .. "/schematics/pine_tree.mts",
                flags = "place_center_x, place_center_z",
        })
 
-       -- Acacia tree
+       minetest.register_decoration({
+               deco_type = "schematic",
+               place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
+               sidelen = 80,
+               noise_params = {
+                       offset = 0.0018,
+                       scale = 0.0011,
+                       spread = {x = 250, y = 250, z = 250},
+                       seed = 2,
+                       octaves = 3,
+                       persist = 0.66
+               },
+               biomes = {"taiga", "coniferous_forest"},
+               y_min = 1,
+               y_max = 31000,
+               schematic = minetest.get_modpath("default") .. "/schematics/pine_log.mts",
+               flags = "place_center_x",
+               rotation = "random",
+       })
+
+       -- Acacia tree and log
 
        minetest.register_decoration({
                deco_type = "schematic",
@@ -1041,8 +1405,69 @@ function default.register_decorations()
                biomes = {"savanna"},
                y_min = 1,
                y_max = 31000,
-               schematic = minetest.get_modpath("default").."/schematics/acacia_tree.mts",
+               schematic = minetest.get_modpath("default") .. "/schematics/acacia_tree.mts",
+               flags = "place_center_x, place_center_z",
+               rotation = "random",
+       })
+
+       minetest.register_decoration({
+               deco_type = "schematic",
+               place_on = {"default:dirt_with_dry_grass"},
+               sidelen = 16,
+               noise_params = {
+                       offset = 0,
+                       scale = 0.001,
+                       spread = {x = 250, y = 250, z = 250},
+                       seed = 2,
+                       octaves = 3,
+                       persist = 0.66
+               },
+               biomes = {"savanna"},
+               y_min = 1,
+               y_max = 31000,
+               schematic = minetest.get_modpath("default") .. "/schematics/acacia_log.mts",
+               flags = "place_center_x",
+               rotation = "random",
+       })
+
+       -- Aspen tree and log
+
+       minetest.register_decoration({
+               deco_type = "schematic",
+               place_on = {"default:dirt_with_grass"},
+               sidelen = 16,
+               noise_params = {
+                       offset = 0.0,
+                       scale = -0.015,
+                       spread = {x = 250, y = 250, z = 250},
+                       seed = 2,
+                       octaves = 3,
+                       persist = 0.66
+               },
+               biomes = {"deciduous_forest"},
+               y_min = 1,
+               y_max = 31000,
+               schematic = minetest.get_modpath("default") .. "/schematics/aspen_tree.mts",
                flags = "place_center_x, place_center_z",
+       })
+
+       minetest.register_decoration({
+               deco_type = "schematic",
+               place_on = {"default:dirt_with_grass"},
+               sidelen = 16,
+               noise_params = {
+                       offset = 0.0,
+                       scale = -0.0008,
+                       spread = {x = 250, y = 250, z = 250},
+                       seed = 2,
+                       octaves = 3,
+                       persist = 0.66
+               },
+               biomes = {"deciduous_forest"},
+               y_min = 1,
+               y_max = 31000,
+               schematic = minetest.get_modpath("default") .. "/schematics/aspen_log.mts",
+               flags = "place_center_x",
                rotation = "random",
        })
 
@@ -1063,7 +1488,7 @@ function default.register_decorations()
                biomes = {"desert"},
                y_min = 5,
                y_max = 31000,
-               schematic = minetest.get_modpath("default").."/schematics/large_cactus.mts",
+               schematic = minetest.get_modpath("default") .. "/schematics/large_cactus.mts",
                flags = "place_center_x",
                rotation = "random",
        })
@@ -1104,10 +1529,52 @@ function default.register_decorations()
                        octaves = 3,
                        persist = 0.7
                },
-               biomes = {"savanna_swamp"},
+               biomes = {"savanna_shore"},
                y_min = 0,
                y_max = 0,
-               schematic = minetest.get_modpath("default").."/schematics/papyrus.mts",
+               schematic = minetest.get_modpath("default") .. "/schematics/papyrus.mts",
+       })
+
+       -- Bush
+
+       minetest.register_decoration({
+               deco_type = "schematic",
+               place_on = {"default:dirt_with_grass", "default:dirt_with_snow"},
+               sidelen = 16,
+               noise_params = {
+                       offset = -0.004,
+                       scale = 0.01,
+                       spread = {x = 100, y = 100, z = 100},
+                       seed = 137,
+                       octaves = 3,
+                       persist = 0.7,
+               },
+               biomes = {"snowy_grassland", "grassland", "deciduous_forest"},
+               y_min = 1,
+               y_max = 31000,
+               schematic = minetest.get_modpath("default") .. "/schematics/bush.mts",
+               flags = "place_center_x, place_center_z",
+       })
+
+       -- Acacia bush
+
+       minetest.register_decoration({
+               deco_type = "schematic",
+               place_on = {"default:dirt_with_dry_grass"},
+               sidelen = 16,
+               noise_params = {
+                       offset = -0.004,
+                       scale = 0.01,
+                       spread = {x = 100, y = 100, z = 100},
+                       seed = 90155,
+                       octaves = 3,
+                       persist = 0.7,
+               },
+               biomes = {"savanna"},
+               y_min = 1,
+               y_max = 31000,
+               schematic = minetest.get_modpath("default") .. "/schematics/acacia_bush.mts",
+               flags = "place_center_x, place_center_z",
        })
 
        -- Grasses
@@ -1130,8 +1597,8 @@ function default.register_decorations()
 
        minetest.register_decoration({
                deco_type = "simple",
-               place_on = {"default:dirt_with_grass"},
-               sidelen = 80,
+               place_on = {"default:dirt_with_rainforest_litter"},
+               sidelen = 16,
                fill_ratio = 0.1,
                biomes = {"rainforest"},
                y_min = 1,
@@ -1143,7 +1610,8 @@ function default.register_decorations()
 
        minetest.register_decoration({
                deco_type = "simple",
-               place_on = {"default:desert_sand", "default:dirt_with_snow"},
+               place_on = {"default:desert_sand",
+                       "default:sand", "default:silver_sand"},
                sidelen = 16,
                noise_params = {
                        offset = 0,
@@ -1153,63 +1621,36 @@ function default.register_decorations()
                        octaves = 3,
                        persist = 0.6
                },
-               biomes = {"desert", "tundra"},
+               biomes = {"desert", "sandstone_desert", "cold_desert"},
                y_min = 2,
                y_max = 31000,
                decoration = "default:dry_shrub",
        })
-end
-
-
---
--- Generate nyan cats
---
 
--- All mapgens except singlenode
-
-function default.make_nyancat(pos, facedir, length)
-       local tailvec = {x = 0, y = 0, z = 0}
-       if facedir == 0 then
-               tailvec.z = 1
-       elseif facedir == 1 then
-               tailvec.x = 1
-       elseif facedir == 2 then
-               tailvec.z = -1
-       elseif facedir == 3 then
-               tailvec.x = -1
-       else
-               facedir = 0
-               tailvec.z = 1
-       end
-       local p = {x = pos.x, y = pos.y, z = pos.z}
-       minetest.set_node(p, {name = "default:nyancat", param2 = facedir})
-       for i = 1, length do
-               p.x = p.x + tailvec.x
-               p.z = p.z + tailvec.z
-               minetest.set_node(p, {name = "default:nyancat_rainbow", param2 = facedir})
-       end
-end
+       -- Coral reef
 
-function default.generate_nyancats(minp, maxp, seed)
-       local height_min = -31000
-       local height_max = -32
-       if maxp.y < height_min or minp.y > height_max then
-               return
-       end
-       local y_min = math.max(minp.y, height_min)
-       local y_max = math.min(maxp.y, height_max)
-       local volume = (maxp.x - minp.x + 1) * (y_max - y_min + 1) * (maxp.z - minp.z + 1)
-       local pr = PseudoRandom(seed + 9324342)
-       local max_num_nyancats = math.floor(volume / (16 * 16 * 16))
-       for i = 1, max_num_nyancats do
-               if pr:next(0, 1000) == 0 then
-                       local x0 = pr:next(minp.x, maxp.x)
-                       local y0 = pr:next(minp.y, maxp.y)
-                       local z0 = pr:next(minp.z, maxp.z)
-                       local p0 = {x = x0, y = y0, z = z0}
-                       default.make_nyancat(p0, pr:next(0, 3), pr:next(3, 15))
-               end
-       end
+       minetest.register_decoration({
+               deco_type = "schematic",
+               place_on = {"default:sand"},
+               noise_params = {
+                       offset = -0.15,
+                       scale = 0.1,
+                       spread = {x = 100, y = 100, z = 100},
+                       seed = 7013,
+                       octaves = 3,
+                       persist = 1,
+               },
+               biomes = {
+                       "desert_ocean",
+                       "savanna_ocean",
+                       "rainforest_ocean",
+               },
+               y_min = -8,
+               y_max = -2,
+               schematic = minetest.get_modpath("default") .. "/schematics/corals.mts",
+               flags = "place_center_x, place_center_z",
+               rotation = "random",
+       })
 end
 
 
@@ -1217,17 +1658,18 @@ end
 -- Detect mapgen to select functions
 --
 
--- Mods using singlenode mapgen can call these functions to enable
--- the use of minetest.generate_ores or minetest.generate_decorations
+minetest.clear_registered_biomes()
+minetest.clear_registered_ores()
+minetest.clear_registered_decorations()
 
-local mg_params = minetest.get_mapgen_params()
-if mg_params.mgname == "v6" then
+local mg_name = minetest.get_mapgen_setting("mg_name")
+if mg_name == "v6" then
+       default.register_mgv6_blob_ores()
        default.register_ores()
        default.register_mgv6_decorations()
-       minetest.register_on_generated(default.generate_nyancats)
-elseif mg_params.mgname ~= "singlenode" then
-       default.register_ores()
+else
        default.register_biomes()
+       default.register_blob_ores()
+       default.register_ores()
        default.register_decorations()
-       minetest.register_on_generated(default.generate_nyancats)
 end