-- =================================================================== -- -- Configuration settings. -- local disable_blob_ores = minetest.setting_getbool ("disable_blob_ores" ) local enable_default_apple = minetest.setting_getbool ("enable_default_apple" ) local enable_wonder = minetest.setting_getbool ("enable_wonder" ) local modpath = minetest.get_modpath ("default") -- =================================================================== -- -- Scratch variables. local clust_scarcity local clust_num_ores local clust_size local ptable -- =================================================================== -- Register ores. -- =================================================================== -- Blob ores. -- These are done first to avoid other ores in blobs. if not disable_blob_ores then -- =================================================================== -- Mgv6 function default.register_mgv6_blob_ores() -- Clay -- This is done first to avoid clay in sand blobs 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 }, }) -- Sand minetest.register_ore({ ore_type = "blob", ore = "default:sand", 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 = 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 in register_mgv6_blob_ores() ptable = { 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 } , } if enable_wonder then ptable.clust_scarcity = 64 * 64 * 64 ptable.ore = "default:gravel" minetest.register_ore (ocutil.clone_table (ptable)) ptable.clust_scarcity = 16 * 16 * 16 ptable.ore = "default:clay" else ptable.clust_scarcity = 16 * 16 * 16 ptable.ore = "default:gravel" end minetest.register_ore (ocutil.clone_table (ptable)) -- =================================================================== -- end of register_mgv6_blob_ores() end -- =================================================================== -- All mapgens except mgv6 function default.register_blob_ores() -- =================================================================== -- Clay in register_blob_ores() 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 in register_blob_ores() ptable = { 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, scale = 0.2, spread = {x = 5, y = 5, z = 5}, seed = 2316, 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", "floatland_ocean", "floatland_grassland", "floatland_coniferous_forest"} } if enable_wonder then ptable.clust_scarcity = 64 * 64 * 64 ptable.ore = "default:silver_sand" minetest.register_ore (ocutil.clone_table (ptable)) ptable.clust_scarcity = 16 * 16 * 16 ptable.ore = "default:clay" else ptable.clust_scarcity = 16 * 16 * 16 ptable.ore = "default:silver_sand" end minetest.register_ore (ocutil.clone_table (ptable)) -- =================================================================== -- Dirt in register_blob_ores() 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 = 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 }, biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest", "deciduous_forest", "deciduous_forest_shore", "savanna", "savanna_shore", "rainforest", "rainforest_swamp", "floatland_grassland", "floatland_coniferous_forest"} }) -- =================================================================== -- Gravel in register_blob_ores() ptable = { 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 }, 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", "floatland_ocean", "floatland_grassland", "floatland_coniferous_forest"} } if enable_wonder then ptable.clust_scarcity = 64 * 64 * 64 ptable.ore = "default:gravel" minetest.register_ore (ocutil.clone_table (ptable)) ptable.clust_scarcity = 16 * 16 * 16 ptable.ore = "default:clay" else ptable.clust_scarcity = 16 * 16 * 16 ptable.ore = "default:gravel" end minetest.register_ore (ocutil.clone_table (ptable)) -- =================================================================== -- end of register_blob_ores() end -- =================================================================== -- end of blob-ores conditional end -- =================================================================== -- All mapgens except singlenode 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 = 8, clust_size = 3, y_min = -31000, y_max = 64, }) minetest.register_ore ({ ore_type = "scatter", ore = "default:stone_with_coal", wherein = "default:stone", clust_scarcity = 24 * 24 * 24, clust_num_ores = 27, clust_size = 6, y_min = -31000, y_max = 0, }) -- =================================================================== -- Iron minetest.register_ore ({ 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, }) minetest.register_ore ({ ore_type = "scatter", ore = "default:stone_with_iron", wherein = "default:stone", clust_scarcity = 9 * 9 * 9, clust_num_ores = 5, clust_size = 3, y_min = -63, y_max = -16, }) 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 = -64, }) 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, }) -- =================================================================== -- Mese minetest.register_ore ({ ore_type = "scatter", ore = "default:stone_with_mese", wherein = "default:stone", clust_scarcity = 18 * 18 * 18, clust_num_ores = 3, clust_size = 2, y_min = -255, y_max = -64, }) minetest.register_ore ({ ore_type = "scatter", ore = "default:stone_with_mese", wherein = "default:stone", clust_scarcity = 14 * 14 * 14, clust_num_ores = 5, clust_size = 3, y_min = -31000, y_max = -256, }) minetest.register_ore ({ ore_type = "scatter" , ore = "default:mese" , wherein = "default:stone" , clust_scarcity = 36 * 36 * 36 , clust_num_ores = 3 , clust_size = 2 , y_max = -1024 , y_min = -31000 , }) -- =================================================================== -- Tin minetest.register_ore ({ ore_type = "scatter" , ore = "default:stone_with_tin" , wherein = "default:stone" , clust_scarcity = 10 * 10 * 10 , clust_num_ores = 5 , clust_size = 3 , y_max = 31000 , y_min = 1025 , }) minetest.register_ore ({ ore_type = "scatter" , ore = "default:stone_with_tin" , wherein = "default:stone" , clust_scarcity = 13 * 13 * 13 , clust_num_ores = 4 , clust_size = 3 , y_max = -32 , y_min = -127 , }) minetest.register_ore ({ ore_type = "scatter" , ore = "default:stone_with_tin" , wherein = "default:stone" , clust_scarcity = 10 * 10 * 10 , clust_num_ores = 5 , clust_size = 3 , y_max = -128 , y_min = -31000 , }) -- =================================================================== -- Gold clust_num_ores = 3 if enable_wonder then clust_num_ores = 5 end minetest.register_ore ({ ore_type = "scatter" , ore = "default:stone_with_gold" , wherein = "default:stone" , clust_scarcity = 15 * 15 * 15 , clust_num_ores = clust_num_ores , clust_size = 2 , y_max = -64 , y_min = -255 , }) minetest.register_ore ({ ore_type = "scatter" , ore = "default:stone_with_gold" , wherein = "default:stone" , clust_scarcity = 13 * 13 * 13 , clust_num_ores = 5 , clust_size = 3 , y_max = -256 , y_min = -31000 , }) -- =================================================================== -- Diamond minetest.register_ore ({ ore_type = "scatter", ore = "default:stone_with_diamond", wherein = "default:stone", clust_scarcity = 17 * 17 * 17, clust_num_ores = 4, clust_size = 3, y_min = -255, y_max = -128, }) 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 = -31000, y_max = -256, }) -- =================================================================== -- Copper clust_scarcity = 12 * 12 * 12 clust_num_ores = 4 clust_size = 3 if enable_wonder then clust_scarcity = 9 * 9 * 9 clust_num_ores = 5 clust_size = 5 end minetest.register_ore ({ ore_type = "scatter" , ore = "default:stone_with_copper" , wherein = "default:stone" , clust_scarcity = clust_scarcity , clust_num_ores = clust_num_ores , clust_size = clust_size , y_max = -16 , y_min = -63 , }) 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_max = -64 , y_min = -31000 , }) -- =================================================================== -- Glowing Fungal Stone. clust_scarcity = 11 * 11 * 11 clust_num_ores = 4 clust_size = 3 minetest.register_ore ({ ore_type = "scatter" , ore = "default:glowing_fungal_stone" , wherein = "default:stone" , clust_scarcity = clust_scarcity , clust_num_ores = clust_num_ores , clust_size = clust_size , y_max = -64 , y_min = -31000 , }) -- =================================================================== -- End of register_ores() end -- =================================================================== -- Register biomes: All mapgens except mgv6 and singlenode function default.register_biomes() minetest.clear_registered_biomes() -- =================================================================== -- Icesheet. minetest.register_biome ({ name = "icesheet", node_dust = "default:snowblock", node_top = "default:snowblock", depth_top = 1, node_filler = "default:snowblock", depth_filler = 3, node_stone = "default:cave_ice", node_water_top = "default:ice", depth_water_top = 10, node_river_water = "default:ice", node_riverbed = "default:gravel", depth_riverbed = 2, y_max = 31000 , y_min = -8, heat_point = 0, humidity_point = 73, }) -- =================================================================== -- Permanent ice minetest.register_biome({ name = "glacier", node_dust = "default:snowblock", node_top = "default:snowblock", depth_top = 1, node_filler = "default:snowblock", depth_filler = 3, node_stone = "default:ice", node_water_top = "default:ice", depth_water_top = 10, --node_water = "", node_river_water = "default:ice", y_min = -8, y_max = 31000, heat_point = 0, humidity_point = 50, }) -- =================================================================== minetest.register_biome({ name = "glacier_ocean", node_dust = "default:snowblock", node_top = "default:sand", depth_top = 1, node_filler = "default:sand", depth_filler = 3, y_min = -112, y_max = -9, heat_point = 0, humidity_point = 50, }) -- =================================================================== -- Cold. minetest.register_biome ({ name = "tundra" , node_top = "default:permafrost_with_stones" , node_filler = "default:permafrost" , node_riverbed = "default:gravel" , depth_filler = 1 , depth_riverbed = 2 , depth_top = 1 , heat_point = 0 , humidity_point = 40 , vertical_blend = 4 , y_max = 46 , y_min = 2 , }) -- =================================================================== minetest.register_biome ({ name = "tundra_beach" , node_top = "default:gravel" , node_filler = "default:gravel" , node_riverbed = "default:gravel" , depth_filler = 2 , depth_riverbed = 2 , depth_top = 1 , heat_point = 0 , humidity_point = 40 , vertical_blend = 1 , y_max = 1 , y_min = -3 , }) -- =================================================================== minetest.register_biome ({ name = "tundra_ocean" , node_top = "default:sand" , node_filler = "default:sand" , node_riverbed = "default:gravel" , node_cave_liquid = "default:water_source" , depth_filler = 3 , depth_riverbed = 2 , depth_top = 1 , heat_point = 0 , humidity_point = 40 , vertical_blend = 1 , y_max = -4 , y_min = -255 , }) -- =================================================================== minetest.register_biome ({ name = "taiga" , node_top = "default:dirt_with_snow" , node_filler = "default:dirt" , node_dust = "default:snow" , node_riverbed = "default:sand" , depth_filler = 3 , depth_riverbed = 2 , depth_top = 1 , heat_point = 25 , humidity_point = 70 , y_max = 31000 , y_min = 4 , }) -- =================================================================== minetest.register_biome({ name = "taiga_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 = "", y_min = -112, y_max = 1, heat_point = 15, humidity_point = 65, }) -- =================================================================== -- Temperate. minetest.register_biome({ name = "stone_grassland", --node_dust = "", node_top = "default:dirt_with_grass", depth_top = 1, node_filler = "default:dirt", depth_filler = 1, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", --node_river_water = "", y_min = 6, y_max = 31000, heat_point = 40, humidity_point = 35, }) -- =================================================================== minetest.register_biome({ name = "stone_grassland_dunes", --node_dust = "", node_top = "default:sand", depth_top = 1, node_filler = "default:sand", depth_filler = 2, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", --node_river_water = "", y_min = 5, y_max = 5, heat_point = 40, humidity_point = 35, }) -- =================================================================== minetest.register_biome({ name = "stone_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 = "", y_min = -112, y_max = 4, heat_point = 40, humidity_point = 35, }) -- =================================================================== minetest.register_biome({ name = "coniferous_forest", --node_dust = "", node_top = "default:dirt_with_grass", depth_top = 1, node_filler = "default:dirt", depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", --node_river_water = "", y_min = 6, y_max = 31000, heat_point = 40, humidity_point = 65, }) -- =================================================================== minetest.register_biome({ name = "coniferous_forest_dunes", --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 = "", y_min = 5, y_max = 5, heat_point = 40, humidity_point = 65, }) -- =================================================================== minetest.register_biome({ name = "coniferous_forest_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 = "", y_min = -112, y_max = 4, heat_point = 40, humidity_point = 65, }) -- =================================================================== minetest.register_biome({ name = "sandstone_grassland", --node_dust = "", node_top = "default:dirt_with_grass", depth_top = 1, node_filler = "default:dirt", depth_filler = 1, node_stone = "default:sandstone", --node_water_top = "", --depth_water_top = , --node_water = "", --node_river_water = "", y_min = 6, y_max = 31000, heat_point = 60, humidity_point = 35, }) -- =================================================================== minetest.register_biome({ name = "sandstone_grassland_dunes", --node_dust = "", node_top = "default:sand", depth_top = 1, node_filler = "default:sand", depth_filler = 2, node_stone = "default:sandstone", --node_water_top = "", --depth_water_top = , --node_water = "", --node_river_water = "", y_min = 5, y_max = 5, heat_point = 60, humidity_point = 35, }) -- =================================================================== minetest.register_biome({ name = "sandstone_grassland_ocean", --node_dust = "", node_top = "default:sand", depth_top = 1, node_filler = "default:sand", depth_filler = 3, node_stone = "default:sandstone", --node_water_top = "", --depth_water_top = , --node_water = "", --node_river_water = "", y_min = -112, y_max = 4, heat_point = 60, humidity_point = 35, }) -- =================================================================== minetest.register_biome({ name = "deciduous_forest", --node_dust = "", node_top = "default:dirt_with_grass", depth_top = 1, node_filler = "default:dirt", depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", --node_river_water = "", y_min = 1, y_max = 31000, heat_point = 60, humidity_point = 65, }) -- =================================================================== minetest.register_biome({ name = "deciduous_forest_swamp", --node_dust = "", node_top = "default:dirt", depth_top = 1, node_filler = "default:dirt", depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", --node_river_water = "", y_min = -15, y_max = 0, heat_point = 60, humidity_point = 65, }) -- =================================================================== minetest.register_biome({ name = "deciduous_forest_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 = "", y_min = -112, y_max = -4, heat_point = 60, humidity_point = 65, }) -- =================================================================== -- Hot. minetest.register_biome({ name = "desert", --node_dust = "", node_top = "default:desert_sand", depth_top = 1, 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 = 5, y_max = 31000, heat_point = 85, humidity_point = 20, }) -- =================================================================== minetest.register_biome({ name = "desert_ocean", --node_dust = "", node_top = "default:sand", depth_top = 1, node_filler = "default:sand", depth_filler = 3, node_stone = "default:desert_stone", --node_water_top = "", --depth_water_top = , --node_water = "", --node_river_water = "", y_min = -112, y_max = 4, heat_point = 85, humidity_point = 20, }) -- =================================================================== minetest.register_biome({ name = "savanna", --node_dust = "", node_top = "default:dirt_with_dry_grass", depth_top = 1, node_filler = "default:dirt", depth_filler = 1, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", --node_river_water = "", y_min = 1, y_max = 31000, heat_point = 85, humidity_point = 50, }) -- =================================================================== minetest.register_biome({ name = "savanna_swamp", --node_dust = "", node_top = "default:dirt", depth_top = 1, node_filler = "default:dirt", depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", --node_river_water = "", y_min = -15, y_max = 0, heat_point = 85, humidity_point = 50, }) -- =================================================================== minetest.register_biome({ name = "savanna_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 = "", y_min = -112, y_max = -4, heat_point = 85, humidity_point = 50, }) -- =================================================================== -- Rain Forest biomes. minetest.register_biome ({ name = "rainforest", --node_dust = "", node_top = "default:dirt_with_rainforest_litter", depth_top = 1, node_filler = "default:dirt", 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 = 1, y_max = 50, heat_point = 86, humidity_point = 65, }) -- =================================================================== minetest.register_biome ({ name = "rainforest_swamp", --node_dust = "", node_top = "default:dirt", depth_top = 1, node_filler = "default:dirt", 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 = -1, y_max = 0, heat_point = 86, humidity_point = 65, }) -- =================================================================== minetest.register_biome ({ name = "rainforest_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 = -2, heat_point = 86, humidity_point = 65, }) -- =================================================================== -- Cold desert. minetest.register_biome({ name = "cold_desert", --node_dust = "", node_top = "default:silver_sand", depth_top = 1, node_filler = "default:silver_sand", 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 = 500, heat_point = 40, humidity_point = 0, }) -- =================================================================== minetest.register_biome({ name = "cold_desert_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 = 40, humidity_point = 0, }) -- =================================================================== -- Underground. -- RJK: "y_min", historically, was -31000 here. We've changed it to -- -1000 to fix a problem related to "caverealms". -- "caverealms" previously included a biome override that made the -- same change. The biome override relied on a buggy routine which -- broke biomes in general. -- To fix the problem, we've disabled the biome override, removed the -- buggy routine, and made the "-1000" change here instead of in -- "caverealms". minetest.register_biome ({ name = "underground" , y_min = -1000 , y_max = -113 , heat_point = 50 , humidity_point = 50 , }) -- =================================================================== -- End of register_biomes() end -- =================================================================== -- Register mapgen v6 decorations. function default.register_mgv6_decorations() minetest.clear_registered_decorations() -- =================================================================== -- Papyrus minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = -0.3, scale = 0.7, spread = {x = 100, y = 100, z = 100}, seed = 354, octaves = 3, persist = 0.7 }, y_min = 1, y_max = 1, decoration = "default:papyrus", height = 2, height_max = 4, spawn_by = "default:water_source", num_spawn_by = 1, }) -- =================================================================== -- Cacti minetest.register_decoration({ deco_type = "simple", place_on = {"default:desert_sand"}, sidelen = 16, noise_params = { offset = -0.012, scale = 0.024, spread = {x = 100, y = 100, z = 100}, seed = 230, octaves = 3, persist = 0.6 }, y_min = 1, y_max = 30, decoration = "default:cactus", height = 3, height_max = 4, }) -- =================================================================== -- Long grasses for length = 1, 5 do minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = 0, scale = 0.007, spread = {x = 100, y = 100, z = 100}, seed = 329, octaves = 3, persist = 0.6 }, y_min = 1, y_max = 30, decoration = "default:grass_"..length, }) end -- =================================================================== -- Dry shrubs minetest.register_decoration({ deco_type = "simple", place_on = {"default:desert_sand", "default:dirt_with_snow"}, sidelen = 16, noise_params = { offset = 0, scale = 0.035, spread = {x = 100, y = 100, z = 100}, seed = 329, octaves = 3, persist = 0.6 }, y_min = 1, y_max = 30, decoration = "default:dry_shrub", }) -- =================================================================== -- End of register_mgv6_decorations() end -- =================================================================== -- Decoration support routines for all mapgens but mgv6 and singlenode local function register_grass_decoration(offset, scale, length) minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass", "default:sand"}, sidelen = 16, noise_params = { offset = offset, scale = scale, spread = {x = 200, y = 200, z = 200}, seed = 329, octaves = 3, persist = 0.6 }, biomes = {"stone_grassland", "sandstone_grassland", "deciduous_forest", "coniferous_forest", "stone_grassland_dunes", "sandstone_grassland_dunes", "coniferous_forest_dunes"}, y_min = 1, y_max = 31000, decoration = "default:grass_"..length, }) end -- =================================================================== local function register_dry_grass_decoration(offset, scale, length) minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_dry_grass"}, sidelen = 16, noise_params = { offset = offset, scale = scale, spread = {x = 200, y = 200, z = 200}, seed = 329, octaves = 3, persist = 0.6 }, biomes = {"savanna"}, y_min = 1, y_max = 31000, decoration = "default:dry_grass_"..length, }) end -- =================================================================== function default.register_decorations() minetest.clear_registered_decorations() -- =================================================================== -- Apple tree and log in register_decorations() minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = 0.036, scale = 0.022, spread = {x = 250, y = 250, z = 250}, seed = 2, octaves = 3, persist = 0.66 }, biomes = {"deciduous_forest"}, y_min = 1, y_max = 31000, schematic = modpath.."/schematics/apple_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.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 = { size = {x = 3, y = 3, z = 1}, data = { {name = "air", prob = 0}, {name = "air", prob = 0}, {name = "air", prob = 0}, {name = "default:tree", param2 = 12, prob = 191}, {name = "default:tree", param2 = 12}, {name = "default:tree", param2 = 12, prob = 127}, {name = "air", prob = 0}, {name = "flowers:mushroom_brown", prob = 63}, {name = "air", prob = 0}, }, }, flags = "place_center_x", rotation = "random", }) -- =================================================================== -- Rain Forest decorations in register_decorations() -- Jungle tree and log minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_rainforest_litter", "default:dirt"}, sidelen = 16, fill_ratio = 0.1, biomes = {"rainforest", "rainforest_swamp"}, y_min = -1, y_max = 31000, schematic = modpath .. "/schematics/jungle_tree.mts", flags = "place_center_x, place_center_z", rotation = "random", }) 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 = modpath .. "/schematics/jungle_log.mts", flags = "place_center_x", rotation = "random", }) -- Junglegrass minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_rainforest_litter"}, sidelen = 16, fill_ratio = 0.1, biomes = {"rainforest"}, y_min = 1, y_max = 31000, decoration = "default:junglegrass", }) -- =================================================================== -- 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.036, scale = 0.022, spread = {x = 250, y = 250, z = 250}, seed = 2, octaves = 3, persist = 0.66 }, biomes = {"taiga", "coniferous_forest"}, y_min = 2, y_max = 31000, schematic = modpath.."/schematics/pine_tree.mts", flags = "place_center_x, place_center_z", }) 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 = { size = {x = 3, y = 3, z = 1}, data = { {name = "air", prob = 0}, {name = "air", prob = 0}, {name = "air", prob = 0}, {name = "default:pine_tree", param2 = 12, prob = 191}, {name = "default:pine_tree", param2 = 12}, {name = "default:pine_tree", param2 = 12, prob = 127}, {name = "air", prob = 0}, {name = "flowers:mushroom_red", prob = 63}, {name = "air", prob = 0}, }, }, flags = "place_center_x", rotation = "random", }) -- Acacia tree and log minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_dry_grass"}, sidelen = 16, noise_params = { offset = 0, scale = 0.002, spread = {x = 250, y = 250, z = 250}, seed = 2, octaves = 3, persist = 0.66 }, biomes = {"savanna"}, y_min = 1, y_max = 31000, schematic = modpath.."/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 = { size = {x = 3, y = 2, z = 1}, data = { {name = "air", prob = 0}, {name = "air", prob = 0}, {name = "air", prob = 0}, {name = "default:acacia_tree", param2 = 12, prob = 191}, {name = "default:acacia_tree", param2 = 12}, {name = "default:acacia_tree", param2 = 12, prob = 127}, }, }, 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 = modpath.."/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 = { size = {x = 3, y = 3, z = 1}, data = { {name = "air", prob = 0}, {name = "air", prob = 0}, {name = "air", prob = 0}, {name = "default:aspen_tree", param2 = 12}, {name = "default:aspen_tree", param2 = 12}, {name = "default:aspen_tree", param2 = 12, prob = 127}, {name = "flowers:mushroom_red", prob = 63}, {name = "flowers:mushroom_brown", prob = 63}, {name = "air", prob = 0}, }, }, flags = "place_center_x", rotation = "random", }) -- Large cactus minetest.register_decoration ({ deco_type = "schematic", place_on = {"default:desert_sand"}, sidelen = 16, noise_params = { offset = -0.0003, scale = 0.0009, spread = {x = 200, y = 200, z = 200}, seed = 230, octaves = 3, persist = 0.6 }, biomes = {"desert"}, y_min = 5, y_max = 31000, schematic = modpath.."/schematics/large_cactus.mts", flags = "place_center_x", rotation = "random", }) -- Cactus minetest.register_decoration ({ deco_type = "simple", place_on = {"default:desert_sand"}, sidelen = 16, noise_params = { offset = -0.0003, scale = 0.0009, spread = {x = 200, y = 200, z = 200}, seed = 230, octaves = 3, persist = 0.6 }, biomes = {"desert"}, y_min = 5, y_max = 31000, decoration = "default:cactus", height = 2, height_max = 5, }) -- =================================================================== -- Oak Tree. -- Jan 2019 experiment by Slopsbucket. minetest.register_decoration ({ deco_type = "simple" , decoration = "default:oak_sapling" , sidelen = 16 , y_max = 500 , y_min = 5 , noise_params = { offset = -0.0003 , scale = 0.0004 , seed = 200 , spread = { x=200, y=200, z=200 } , octaves = 3 , persist = 0.6 , } , place_on = { "default:dirt_with_grass" , } , biomes = { "sandstone_grassland" , "stone_grassland" , } , }) -- =================================================================== -- Spruce Tree. -- Jan 2019 experiment by Slopsbucket. minetest.register_decoration ({ deco_type = "simple" , decoration = "default:spruce_sapling" , sidelen = 16 , y_max = 500 , y_min = 5 , noise_params = { offset = -0.0003 , scale = 0.0004 , seed = 210 , spread = { x=200, y=200, z=200 } , octaves = 3 , persist = 0.6 , }, place_on = { "default:dirt_with_grass" , } , biomes = { "coniferous_forest" , "taiga" , } , }) -- =================================================================== -- Sequoia Tree. -- Jan 2019 experiment by Slopsbucket. minetest.register_decoration ({ deco_type = "simple" , decoration = "default:sequoia_sapling" , sidelen = 16 , y_max = 500 , y_min = 1 , noise_params = { offset = -0.0003 , scale = 0.0009 , seed = 220 , spread = { x=200, y=200, z=200 } , octaves = 3 , persist = 0.6 , }, place_on = { "default:dirt" , "default:dirt_with_rainforest_litter" , } , biomes = { "rainforest" , "rainforest_swamp" , } , }) -- =================================================================== -- Willow Tree. -- Slopsbucket: Jan 2019. minetest.register_decoration ({ deco_type = "simple" , decoration = "default:willow_sapling" , sidelen = 16 , y_max = 15 , y_min = 1 , noise_params = { offset = -0.0003 , scale = 0.0009 , spread = { x=200, y=200, z=200 } , seed = 230 , octaves = 3 , persist = 0.6 , }, place_on = { "default:dirt_with_dry_grass" , } , biomes = { "savanna" , "savanna_swamp" , } , }) -- =================================================================== -- More Trees. -- Slopsbucket: May 2019. minetest.register_decoration ({ deco_type = "simple" , decoration = "default:beech_sapling" , sidelen = 16 , y_max = 500 , y_min = 5 , noise_params = { offset = -0.0003 , scale = 0.0006 , seed = 240 , spread = { x=200, y=200, z=200 } , octaves = 3 , persist = 0.6 , } , place_on = { "default:dirt_with_grass" , } , biomes = { "deciduous_forest" , } , }) minetest.register_decoration ({ deco_type = "simple" , decoration = "default:big_apple_sapling" , sidelen = 16 , y_max = 500 , y_min = 5 , noise_params = { offset = -0.0003 , scale = 0.0006 , seed = 250 , spread = { x=200, y=200, z=200 } , octaves = 3 , persist = 0.4 , } , place_on = { "default:dirt_with_grass" , } , biomes = { "sandstone_grassland" , "stone_grassland" , } , }) minetest.register_decoration ({ deco_type = "simple" , decoration = "default:birch_sapling" , sidelen = 16 , y_max = 500 , y_min = 5 , noise_params = { offset = -0.0003 , scale = 0.0004 , seed = 260 , spread = { x=200, y=200, z=200 } , octaves = 3 , persist = 0.6 , } , place_on = { "default:dirt_with_grass" , } , biomes = { "deciduous_forest" , } , }) minetest.register_decoration ({ deco_type = "simple" , decoration = "default:cedar_sapling" , sidelen = 16 , y_max = 500 , y_min = 5 , noise_params = { offset = -0.0003 , scale = 0.0004 , seed = 270 , spread = { x=200, y=200, z=200 } , octaves = 3 , persist = 0.6 , } , place_on = { "default:dirt_with_grass" , } , biomes = { "deciduous_forest" , "rainforest" , } , }) minetest.register_decoration ({ deco_type = "simple" , decoration = "default:date_palm_sapling" , sidelen = 16 , y_max = 7 , y_min = 1 , noise_params = { offset = -0.0003 , scale = 0.0006 , seed = 280 , spread = { x=200, y=200, z=200 } , octaves = 3 , persist = 0.6 , } , place_on = { "default:sand" , } , 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", "floatland_ocean", "floatland_grassland", "floatland_coniferous_forest" } , }) minetest.register_decoration ({ deco_type = "simple" , decoration = "default:fir_sapling" , sidelen = 16 , y_max = 500 , y_min = 5 , noise_params = { offset = -0.0003 , scale = 0.0006 , seed = 290 , spread = { x=200, y=200, z=200 } , octaves = 3 , persist = 0.6 , } , place_on = { "default:dirt_with_grass" , } , biomes = { "coniferous_forest" , } , }) minetest.register_decoration ({ deco_type = "simple" , decoration = "default:palm_sapling" , sidelen = 16 , y_max = 7 , y_min = 1 , noise_params = { offset = -0.0003 , scale = 0.0006 , seed = 300 , spread = { x=200, y=200, z=200 } , octaves = 3 , persist = 0.6 , } , place_on = { "default:sand" , } , 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", "floatland_ocean", "floatland_grassland", "floatland_coniferous_forest" } , }) minetest.register_decoration ({ deco_type = "simple" , decoration = "default:poplar_sapling" , sidelen = 16 , y_max = 500 , y_min = 5 , noise_params = { offset = -0.0003 , scale = 0.0006 , seed = 310 , spread = { x=200, y=200, z=200 } , octaves = 3 , persist = 0.4 , } , place_on = { "default:dirt_with_grass" , } , biomes = { "deciduous_forest" , "stone_grassland" , } , }) -- =================================================================== -- Iroko Tree. minetest.register_decoration ({ deco_type = "simple" , decoration = "default:iroko_sapling" , flags = "place_center_x" , rotation = "random" , sidelen = 16 , y_max = 500 , y_min = 5 , place_on = { "default:dirt_with_trygrass" , "default:dirt_with_grass" , "default:dirt_with_rainforest_litter" , } , noise_params = { offset = 0.005 , scale = 0.005 , spread = { x = 250, y = 250, z = 250 } , seed = 2 , octaves = 3 , persist = 0.66 } , biomes = { "coniferous_forest" , "rainforest" , "savanna_swamp" , } , }) -- =================================================================== -- Papyrus. minetest.register_decoration ({ deco_type = "schematic", place_on = {"default:dirt"}, sidelen = 16, noise_params = { offset = -0.3, scale = 0.7, spread = {x = 200, y = 200, z = 200}, seed = 354, octaves = 3, persist = 0.7 }, biomes = {"savanna_swamp"}, y_min = 0, y_max = 0, schematic = modpath.."/schematics/papyrus.mts", }) -- Grasses register_grass_decoration(-0.03, 0.09, 5) register_grass_decoration(-0.015, 0.075, 4) register_grass_decoration(0, 0.06, 3) register_grass_decoration(0.015, 0.045, 2) register_grass_decoration(0.03, 0.03, 1) -- Dry grasses register_dry_grass_decoration(0.01, 0.05, 5) register_dry_grass_decoration(0.03, 0.03, 4) register_dry_grass_decoration(0.05, 0.01, 3) register_dry_grass_decoration(0.07, -0.01, 2) register_dry_grass_decoration(0.09, -0.03, 1) -- Dry shrub minetest.register_decoration({ deco_type = "simple", place_on = {"default:desert_sand", "default:dirt_with_snow"}, sidelen = 16, noise_params = { offset = 0, scale = 0.02, spread = {x = 200, y = 200, z = 200}, seed = 329, octaves = 3, persist = 0.6 }, biomes = {"desert", "tundra"}, y_min = 2, y_max = 31000, decoration = "default:dry_shrub", }) -- =================================================================== -- Coral reef 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 = modpath .. "/schematics/corals.mts", flags = "place_center_x, place_center_z", rotation = "random", }) -- =================================================================== -- Cherry Tree -- based on example from Cool Trees. minetest.register_decoration ({ deco_type = "schematic" , sidelen = 16 , y_min = 1 , y_max = 32 , biomes = { "deciduous_forest" } , place_on = { "default:dirt_with_grass" } , noise_params = { offset = 0.0005, scale = 0.00005, spread = {x = 250, y = 250, z = 250}, seed = 2, octaves = 3, persist = 0.66 } , schematic = modpath .. "/schematics/cherry_tree.mts" , flags = "place_center_x, place_center_z" , rotation = "random" , }) -- =================================================================== -- Lemon Tree -- based on example from Cool Trees. minetest.register_decoration ({ deco_type = "schematic" , sidelen = 16 , y_min = 1 , y_max = 80 , biomes = { "deciduous_forest" } , place_on = { "default:dirt_with_grass" } , noise_params = { offset = 0.0005, scale = 0.00005, spread = {x = 250, y = 250, z = 250}, seed = 2, octaves = 3, persist = 0.66 }, schematic = modpath .. "/schematics/lemon_tree.mts" , flags = "place_center_x, place_center_z" , rotation = "random" , }) -- =================================================================== -- Maple Tree -- descended from Maple Tree mod. minetest.register_decoration ({ deco_type = "schematic" , sidelen = 16 , y_min = 1 , y_max = 80 , biomes = { "deciduous_forest" } , place_on = { "default:dirt_with_grass" } , noise_params = { octaves = 3 , offset = 0.0000 , persist = 0.6600 , scale = 0.0007 , seed = 2 , spread = { x = 250, y = 250, z = 250 } , } , schematic = modpath .. "/schematics/maple_tree.mts" , flags = "place_center_x, place_center_z" , }) -- =================================================================== -- End of default.register_decorations() 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 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 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 local mg_params = minetest.get_mapgen_params() if mg_params.mgname == "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_biomes() default.register_blob_ores() default.register_ores() default.register_decorations() minetest.register_on_generated (default.generate_nyancats) end