From fc64907b15a3a37613a1c6ed835a35054fe66218 Mon Sep 17 00:00:00 2001 From: cora Date: Tue, 30 Aug 2022 03:39:29 +0200 Subject: [PATCH] move mapgen ores regs to separate file --- mods/MAPGEN/mcl_mapgen_core/init.lua | 1078 +------------------------- mods/MAPGEN/mcl_mapgen_core/ores.lua | 616 +++++++++++++++ 2 files changed, 620 insertions(+), 1074 deletions(-) create mode 100644 mods/MAPGEN/mcl_mapgen_core/ores.lua diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index d3f0af6c5..5808f4def 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -4,6 +4,9 @@ local registered_generators = {} local lvm, nodes, param2 = 0, 0, 0 local lvm_buffer = {} +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) + -- -- Aliases for map generator outputs -- @@ -87,1080 +90,7 @@ local c_cocoa_3 = minetest.get_content_id("mcl_cocoas:cocoa_3") local c_vine = minetest.get_content_id("mcl_core:vine") local c_air = minetest.CONTENT_AIR --- --- Ore generation --- - --- Diorite, andesite and granite -local specialstones = { "mcl_core:diorite", "mcl_core:andesite", "mcl_core:granite" } -for s=1, #specialstones do - local node = specialstones[s] - minetest.register_ore({ - ore_type = "blob", - ore = node, - wherein = {"mcl_core:stone"}, - clust_scarcity = 15*15*15, - clust_num_ores = 33, - clust_size = 5, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, - noise_params = { - offset = 0, - scale = 1, - spread = {x=250, y=250, z=250}, - seed = 12345, - octaves = 3, - persist = 0.6, - lacunarity = 2, - flags = "defaults", - } - }) - minetest.register_ore({ - ore_type = "blob", - ore = node, - wherein = {"mcl_core:stone"}, - clust_scarcity = 10*10*10, - clust_num_ores = 58, - clust_size = 7, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, - noise_params = { - offset = 0, - scale = 1, - spread = {x=250, y=250, z=250}, - seed = 12345, - octaves = 3, - persist = 0.6, - lacunarity = 2, - flags = "defaults", - } - }) -end - -local stonelike = {"mcl_core:stone", "mcl_core:diorite", "mcl_core:andesite", "mcl_core:granite"} - --- Dirt -minetest.register_ore({ - ore_type = "blob", - ore = "mcl_core:dirt", - wherein = stonelike, - clust_scarcity = 15*15*15, - clust_num_ores = 33, - clust_size = 4, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, - noise_params = { - offset = 0, - scale = 1, - spread = {x=250, y=250, z=250}, - seed = 12345, - octaves = 3, - persist = 0.6, - lacunarity = 2, - flags = "defaults", - } -}) - --- Gravel -minetest.register_ore({ - ore_type = "blob", - ore = "mcl_core:gravel", - wherein = stonelike, - clust_scarcity = 14*14*14, - clust_num_ores = 33, - clust_size = 5, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(111), - noise_params = { - offset = 0, - scale = 1, - spread = {x=250, y=250, z=250}, - seed = 12345, - octaves = 3, - persist = 0.6, - lacunarity = 2, - flags = "defaults", - } -}) - -if minetest.settings:get_bool("mcl_generate_ores", true) then - -- - -- Coal - -- - - -- Common spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_coal", - wherein = stonelike, - clust_scarcity = 525*3, - clust_num_ores = 5, - clust_size = 3, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(50), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_coal", - wherein = stonelike, - clust_scarcity = 510*3, - clust_num_ores = 8, - clust_size = 3, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(50), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_coal", - wherein = stonelike, - clust_scarcity = 500*3, - clust_num_ores = 12, - clust_size = 3, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(50), - }) - - -- Medium-rare spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_coal", - wherein = stonelike, - clust_scarcity = 550*3, - clust_num_ores = 4, - clust_size = 2, - y_min = mcl_worlds.layer_to_y(51), - y_max = mcl_worlds.layer_to_y(80), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_coal", - wherein = stonelike, - clust_scarcity = 525*3, - clust_num_ores = 6, - clust_size = 3, - y_min = mcl_worlds.layer_to_y(51), - y_max = mcl_worlds.layer_to_y(80), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_coal", - wherein = stonelike, - clust_scarcity = 500*3, - clust_num_ores = 8, - clust_size = 3, - y_min = mcl_worlds.layer_to_y(51), - y_max = mcl_worlds.layer_to_y(80), - }) - - -- Rare spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_coal", - wherein = stonelike, - clust_scarcity = 600*3, - clust_num_ores = 3, - clust_size = 2, - y_min = mcl_worlds.layer_to_y(81), - y_max = mcl_worlds.layer_to_y(128), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_coal", - wherein = stonelike, - clust_scarcity = 550*3, - clust_num_ores = 4, - clust_size = 3, - y_min = mcl_worlds.layer_to_y(81), - y_max = mcl_worlds.layer_to_y(128), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_coal", - wherein = stonelike, - clust_scarcity = 500*3, - clust_num_ores = 5, - clust_size = 3, - y_min = mcl_worlds.layer_to_y(81), - y_max = mcl_worlds.layer_to_y(128), - }) - - -- - -- Iron - -- - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_iron", - wherein = stonelike, - clust_scarcity = 830, - clust_num_ores = 5, - clust_size = 3, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(39), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_iron", - wherein = stonelike, - clust_scarcity = 1660, - clust_num_ores = 4, - clust_size = 2, - y_min = mcl_worlds.layer_to_y(40), - y_max = mcl_worlds.layer_to_y(63), - }) - - -- - -- Gold - -- - - -- Common spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_gold", - wherein = stonelike, - clust_scarcity = 4775, - clust_num_ores = 5, - clust_size = 3, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(30), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_gold", - wherein = stonelike, - clust_scarcity = 6560, - clust_num_ores = 7, - clust_size = 3, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(30), - }) - - -- Rare spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_gold", - wherein = stonelike, - clust_scarcity = 13000, - clust_num_ores = 4, - clust_size = 2, - y_min = mcl_worlds.layer_to_y(31), - y_max = mcl_worlds.layer_to_y(33), - }) - - -- - -- Diamond - -- - - -- Common spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_diamond", - wherein = stonelike, - clust_scarcity = 10000, - clust_num_ores = 4, - clust_size = 3, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(12), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_diamond", - wherein = stonelike, - clust_scarcity = 5000, - clust_num_ores = 2, - clust_size = 2, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(12), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_diamond", - wherein = stonelike, - clust_scarcity = 10000, - clust_num_ores = 8, - clust_size = 3, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(12), - }) - - -- Rare spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_diamond", - wherein = stonelike, - clust_scarcity = 20000, - clust_num_ores = 1, - clust_size = 1, - y_min = mcl_worlds.layer_to_y(13), - y_max = mcl_worlds.layer_to_y(15), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_diamond", - wherein = stonelike, - clust_scarcity = 20000, - clust_num_ores = 2, - clust_size = 2, - y_min = mcl_worlds.layer_to_y(13), - y_max = mcl_worlds.layer_to_y(15), - }) - - -- - -- Ancient debris - -- - local ancient_debris_wherein = {"mcl_nether:netherrack","mcl_blackstone:blackstone","mcl_blackstone:basalt"} - -- Common spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_nether:ancient_debris", - wherein = ancient_debris_wherein, - clust_scarcity = 25000, -- 0.004% chance - clust_num_ores = 3, - clust_size = 3, - y_min = mcl_vars.mg_nether_min + 8, - y_max = mcl_vars.mg_nether_min + 22, - }) - - -- Rare spawn (below) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_nether:ancient_debris", - wherein = ancient_debris_wherein, - clust_scarcity = 32000, - clust_num_ores = 2, - clust_size = 3, - y_min = mcl_vars.mg_nether_min, - y_max = mcl_vars.mg_nether_min + 8, - }) - - -- Rare spawn (above) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_nether:ancient_debris", - wherein = ancient_debris_wherein, - clust_scarcity = 32000, - clust_num_ores = 2, - clust_size = 3, - y_min = mcl_vars.mg_nether_min + 22, - y_max = mcl_vars.mg_nether_min + 119, - }) - - -- - -- Redstone - -- - - -- Common spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_redstone", - wherein = stonelike, - clust_scarcity = 500, - clust_num_ores = 4, - clust_size = 3, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(13), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_redstone", - wherein = stonelike, - clust_scarcity = 800, - clust_num_ores = 7, - clust_size = 4, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(13), - }) - - -- Rare spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_redstone", - wherein = stonelike, - clust_scarcity = 1000, - clust_num_ores = 4, - clust_size = 3, - y_min = mcl_worlds.layer_to_y(13), - y_max = mcl_worlds.layer_to_y(15), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_redstone", - wherein = stonelike, - clust_scarcity = 1600, - clust_num_ores = 7, - clust_size = 4, - y_min = mcl_worlds.layer_to_y(13), - y_max = mcl_worlds.layer_to_y(15), - }) - - -- - -- Emerald - -- - - if mg_name == "v6" then - -- Generate everywhere in v6, but rarely. - - -- Common spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_emerald", - wherein = stonelike, - clust_scarcity = 14340, - clust_num_ores = 1, - clust_size = 1, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_worlds.layer_to_y(29), - }) - -- Rare spawn - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_emerald", - wherein = stonelike, - clust_scarcity = 21510, - clust_num_ores = 1, - clust_size = 1, - y_min = mcl_worlds.layer_to_y(30), - y_max = mcl_worlds.layer_to_y(32), - }) - end - - -- - -- Lapis Lazuli - -- - - -- Common spawn (in the center) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_lapis", - wherein = stonelike, - clust_scarcity = 10000, - clust_num_ores = 7, - clust_size = 4, - y_min = mcl_worlds.layer_to_y(14), - y_max = mcl_worlds.layer_to_y(16), - }) - - -- Rare spawn (below center) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_lapis", - wherein = stonelike, - clust_scarcity = 12000, - clust_num_ores = 6, - clust_size = 3, - y_min = mcl_worlds.layer_to_y(10), - y_max = mcl_worlds.layer_to_y(13), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_lapis", - wherein = stonelike, - clust_scarcity = 14000, - clust_num_ores = 5, - clust_size = 3, - y_min = mcl_worlds.layer_to_y(6), - y_max = mcl_worlds.layer_to_y(9), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_lapis", - wherein = stonelike, - clust_scarcity = 16000, - clust_num_ores = 4, - clust_size = 3, - y_min = mcl_worlds.layer_to_y(2), - y_max = mcl_worlds.layer_to_y(5), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_lapis", - wherein = stonelike, - clust_scarcity = 18000, - clust_num_ores = 3, - clust_size = 2, - y_min = mcl_worlds.layer_to_y(0), - y_max = mcl_worlds.layer_to_y(2), - }) - - -- Rare spawn (above center) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_lapis", - wherein = stonelike, - clust_scarcity = 12000, - clust_num_ores = 6, - clust_size = 3, - y_min = mcl_worlds.layer_to_y(17), - y_max = mcl_worlds.layer_to_y(20), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_lapis", - wherein = stonelike, - clust_scarcity = 14000, - clust_num_ores = 5, - clust_size = 3, - y_min = mcl_worlds.layer_to_y(21), - y_max = mcl_worlds.layer_to_y(24), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_lapis", - wherein = stonelike, - clust_scarcity = 16000, - clust_num_ores = 4, - clust_size = 3, - y_min = mcl_worlds.layer_to_y(25), - y_max = mcl_worlds.layer_to_y(28), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_lapis", - wherein = stonelike, - clust_scarcity = 18000, - clust_num_ores = 3, - clust_size = 2, - y_min = mcl_worlds.layer_to_y(29), - y_max = mcl_worlds.layer_to_y(32), - }) - minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:stone_with_lapis", - wherein = stonelike, - clust_scarcity = 32000, - clust_num_ores = 1, - clust_size = 1, - y_min = mcl_worlds.layer_to_y(31), - y_max = mcl_worlds.layer_to_y(32), - }) -end - -if not superflat then --- Water and lava springs (single blocks of lava/water source) --- Water appears at nearly every height, but not near the bottom -minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:water_source", - wherein = {"mcl_core:stone", "mcl_core:andesite", "mcl_core:diorite", "mcl_core:granite", "mcl_core:dirt"}, - clust_scarcity = 9000, - clust_num_ores = 1, - clust_size = 1, - y_min = mcl_worlds.layer_to_y(5), - y_max = mcl_worlds.layer_to_y(128), -}) - --- Lava springs are rather common at -31 and below -minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:lava_source", - wherein = stonelike, - clust_scarcity = 2000, - clust_num_ores = 1, - clust_size = 1, - y_min = mcl_worlds.layer_to_y(1), - y_max = mcl_worlds.layer_to_y(10), -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:lava_source", - wherein = stonelike, - clust_scarcity = 9000, - clust_num_ores = 1, - clust_size = 1, - y_min = mcl_worlds.layer_to_y(11), - y_max = mcl_worlds.layer_to_y(31), -}) - --- Lava springs will become gradually rarer with increasing height -minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:lava_source", - wherein = stonelike, - clust_scarcity = 32000, - clust_num_ores = 1, - clust_size = 1, - y_min = mcl_worlds.layer_to_y(32), - y_max = mcl_worlds.layer_to_y(47), -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:lava_source", - wherein = stonelike, - clust_scarcity = 72000, - clust_num_ores = 1, - clust_size = 1, - y_min = mcl_worlds.layer_to_y(48), - y_max = mcl_worlds.layer_to_y(61), -}) - --- Lava may even appear above surface, but this is very rare -minetest.register_ore({ - ore_type = "scatter", - ore = "mcl_core:lava_source", - wherein = stonelike, - clust_scarcity = 96000, - clust_num_ores = 1, - clust_size = 1, - y_min = mcl_worlds.layer_to_y(62), - y_max = mcl_worlds.layer_to_y(127), -}) -end - -local function register_mgv6_decorations() - - -- Cacti - minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:sand"}, - sidelen = 16, - noise_params = { - offset = -0.012, - scale = 0.024, - spread = {x = 100, y = 100, z = 100}, - seed = 257, - octaves = 3, - persist = 0.6 - }, - y_min = 4, - y_max = mcl_vars.mg_overworld_max, - decoration = "mcl_core:cactus", - height = 1, - height_max = 3, - }) - - -- Sugar canes - minetest.register_decoration({ - deco_type = "simple", - place_on = {"mcl_core:dirt", "mcl_core:coarse_dirt", "group:grass_block_no_snow", "group:sand", "mcl_core:podzol", "mcl_core:reeds"}, - sidelen = 16, - noise_params = { - offset = -0.3, - scale = 0.7, - spread = {x = 100, y = 100, z = 100}, - seed = 465, - octaves = 3, - persist = 0.7 - }, - y_min = 1, - y_max = mcl_vars.mg_overworld_max, - decoration = "mcl_core:reeds", - height = 1, - height_max = 3, - spawn_by = { "mcl_core:water_source", "group:frosted_ice" }, - num_spawn_by = 1, - }) - - -- Doubletall grass - minetest.register_decoration({ - deco_type = "schematic", - schematic = { - size = { x=1, y=3, z=1 }, - data = { - { name = "air", prob = 0 }, - { name = "mcl_flowers:double_grass", param1 = 255, }, - { name = "mcl_flowers:double_grass_top", param1 = 255, }, - }, - }, - place_on = {"group:grass_block_no_snow"}, - sidelen = 8, - noise_params = { - offset = -0.0025, - scale = 0.03, - spread = {x = 100, y = 100, z = 100}, - seed = 420, - octaves = 3, - persist = 0.0, - }, - y_min = 1, - y_max = mcl_vars.mg_overworld_max, - }) - - -- Large ferns - minetest.register_decoration({ - deco_type = "schematic", - schematic = { - size = { x=1, y=3, z=1 }, - data = { - { name = "air", prob = 0 }, - { name = "mcl_flowers:double_fern", param1=255, }, - { name = "mcl_flowers:double_fern_top", param1=255, }, - }, - }, - -- v6 hack: This makes sure large ferns only appear in jungles - spawn_by = { "mcl_core:jungletree", "mcl_flowers:fern" }, - num_spawn_by = 1, - place_on = {"group:grass_block_no_snow"}, - - sidelen = 16, - noise_params = { - offset = 0, - scale = 0.01, - spread = {x = 250, y = 250, z = 250}, - seed = 333, - octaves = 2, - persist = 0.66, - }, - y_min = 1, - y_max = mcl_vars.mg_overworld_max, - }) - - -- Large flowers - local function register_large_flower(name, seed, offset) - minetest.register_decoration({ - deco_type = "schematic", - schematic = { - size = { x=1, y=3, z=1 }, - data = { - { name = "air", prob = 0 }, - { name = "mcl_flowers:"..name, param1=255, }, - { name = "mcl_flowers:"..name.."_top", param1=255, }, - }, - }, - place_on = {"group:grass_block_no_snow"}, - - sidelen = 16, - noise_params = { - offset = offset, - scale = 0.01, - spread = {x = 300, y = 300, z = 300}, - seed = seed, - octaves = 5, - persist = 0.62, - }, - y_min = 1, - y_max = mcl_vars.overworld_max, - flags = "", - }) - end - - register_large_flower("rose_bush", 9350, -0.008) - register_large_flower("peony", 10450, -0.008) - register_large_flower("lilac", 10600, -0.007) - register_large_flower("sunflower", 2940, -0.005) - - -- Lily pad - minetest.register_decoration({ - deco_type = "schematic", - schematic = { - size = { x=1, y=3, z=1 }, - data = { - { name = "mcl_core:water_source", prob = 0 }, - { name = "mcl_core:water_source" }, - { name = "mcl_flowers:waterlily", param1 = 255 }, - }, - }, - place_on = "mcl_core:dirt", - sidelen = 16, - noise_params = { - offset = -0.12, - scale = 0.3, - spread = {x = 200, y = 200, z = 200}, - seed = 503, - octaves = 6, - persist = 0.7, - }, - y_min = 0, - y_max = 0, - rotation = "random", - }) - - -- Pumpkin - minetest.register_decoration({ - deco_type = "simple", - decoration = "mcl_farming:pumpkin", - param2 = 0, - param2_max = 3, - place_on = {"group:grass_block_no_snow"}, - sidelen = 16, - noise_params = { - offset = -0.008, - scale = 0.00666, - spread = {x = 250, y = 250, z = 250}, - seed = 666, - octaves = 6, - persist = 0.666 - }, - y_min = 1, - y_max = mcl_vars.overworld_max, - }) - - -- Melon - minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:grass_block_no_snow"}, - sidelen = 16, - noise_params = { - offset = 0.002, - scale = 0.006, - spread = {x = 250, y = 250, z = 250}, - seed = 333, - octaves = 3, - persist = 0.6 - }, - -- Small trick to make sure melon spawn in jungles - spawn_by = { "mcl_core:jungletree", "mcl_flowers:fern" }, - num_spawn_by = 1, - y_min = 1, - y_max = 40, - decoration = "mcl_farming:melon", - }) - - -- Tall grass - minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:grass_block_no_snow"}, - sidelen = 8, - noise_params = { - offset = 0.01, - scale = 0.3, - spread = {x = 100, y = 100, z = 100}, - seed = 420, - octaves = 3, - persist = 0.6 - }, - y_min = 1, - y_max = mcl_vars.overworld_max, - decoration = "mcl_flowers:tallgrass", - }) - minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:grass_block_no_snow"}, - sidelen = 8, - noise_params = { - offset = 0.04, - scale = 0.03, - spread = {x = 100, y = 100, z = 100}, - seed = 420, - octaves = 3, - persist = 0.6 - }, - y_min = 1, - y_max = mcl_vars.overworld_max, - decoration = "mcl_flowers:tallgrass", - }) - - -- Seagrass and kelp - local materials = {"dirt","sand"} - for i=1, #materials do - local mat = materials[i] - - minetest.register_decoration({ - deco_type = "simple", - spawn_by = {"group:water"}, - num_spawn_by = 1, - place_on = {"mcl_core:"..mat}, - sidelen = 8, - noise_params = { - offset = 0.04, - scale = 0.3, - spread = {x = 100, y = 100, z = 100}, - seed = 421, - octaves = 3, - persist = 0.6 - }, - flags = "force_placement", - place_offset_y = -1, - y_min = mcl_vars.overworld_min, - y_max = 0, - decoration = "mcl_ocean:seagrass_"..mat, - }) - minetest.register_decoration({ - deco_type = "simple", - spawn_by = {"group:water"}, - num_spawn_by = 1, - place_on = {"mcl_core:mat"}, - sidelen = 8, - noise_params = { - offset = 0.08, - scale = 0.03, - spread = {x = 100, y = 100, z = 100}, - seed = 421, - octaves = 3, - persist = 0.6 - }, - flags = "force_placement", - place_offset_y = -1, - y_min = mcl_vars.overworld_min, - y_max = -5, - decoration = "mcl_ocean:seagrass_"..mat, - }) - - minetest.register_decoration({ - deco_type = "simple", - spawn_by = {"group:water"}, - num_spawn_by = 1, - place_on = {"mcl_core:"..mat}, - sidelen = 16, - noise_params = { - offset = 0.01, - scale = 0.01, - spread = {x = 300, y = 300, z = 300}, - seed = 505, - octaves = 5, - persist = 0.62, - }, - flags = "force_placement", - place_offset_y = -1, - y_min = mcl_vars.overworld_min, - y_max = -6, - decoration = "mcl_ocean:kelp_"..mat, - param2 = 16, - param2_max = 96, - }) - minetest.register_decoration({ - deco_type = "simple", - spawn_by = {"group:water"}, - num_spawn_by = 1, - place_on = {"mcl_core:"..mat}, - sidelen = 16, - noise_params = { - offset = 0.01, - scale = 0.01, - spread = {x = 100, y = 100, z = 100}, - seed = 506, - octaves = 5, - persist = 0.62, - }, - flags = "force_placement", - place_offset_y = -1, - y_min = mcl_vars.overworld_min, - y_max = -15, - decoration = "mcl_ocean:kelp_"..mat, - param2 = 32, - param2_max = 160, - }) - - end - - -- Wet Sponge - -- TODO: Remove this when we got ocean monuments - minetest.register_decoration({ - deco_type = "simple", - decoration = "mcl_sponges:sponge_wet", - spawn_by = {"group:water"}, - num_spawn_by = 1, - place_on = {"mcl_core:dirt","mcl_core:sand"}, - sidelen = 16, - noise_params = { - offset = 0.00295, - scale = 0.006, - spread = {x = 250, y = 250, z = 250}, - seed = 999, - octaves = 3, - persist = 0.666 - }, - flags = "force_placement", - y_min = mcl_vars.mg_lava_overworld_max + 5, - y_max = -20, - }) - - -- Add a small amount of tall grass everywhere to avoid areas completely empty devoid of tall grass - minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:grass_block_no_snow"}, - sidelen = 8, - fill_ratio = 0.004, - y_min = 1, - y_max = mcl_vars.overworld_max, - decoration = "mcl_flowers:tallgrass", - }) - - local mushrooms = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown"} - local mseeds = { 7133, 8244 } - for m=1, #mushrooms do - -- Mushrooms next to trees - minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:grass_block_no_snow", "mcl_core:dirt", "mcl_core:podzol", "mcl_core:mycelium", "mcl_core:stone", "mcl_core:andesite", "mcl_core:diorite", "mcl_core:granite"}, - sidelen = 16, - noise_params = { - offset = 0.04, - scale = 0.04, - spread = {x = 100, y = 100, z = 100}, - seed = mseeds[m], - octaves = 3, - persist = 0.6 - }, - y_min = 1, - y_max = mcl_vars.mg_overworld_max, - decoration = mushrooms[m], - spawn_by = { "mcl_core:tree", "mcl_core:sprucetree", "mcl_core:darktree", "mcl_core:birchtree", }, - num_spawn_by = 1, - }) - end - - -- Dead bushes - minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:sand", "mcl_core:podzol", "mcl_core:dirt", "mcl_core:coarse_dirt", "group:hardened_clay"}, - sidelen = 16, - noise_params = { - offset = 0, - scale = 0.035, - spread = {x = 100, y = 100, z = 100}, - seed = 1972, - octaves = 3, - persist = 0.6 - }, - y_min = 4, - y_max = mcl_vars.mg_overworld_max, - decoration = "mcl_core:deadbush", - }) - - local function register_mgv6_flower(name, seed, offset, y_max) - if offset == nil then - offset = 0 - end - if y_max == nil then - y_max = mcl_vars.mg_overworld_max - end - minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:grass_block_no_snow"}, - sidelen = 16, - noise_params = { - offset = offset, - scale = 0.006, - spread = {x = 100, y = 100, z = 100}, - seed = seed, - octaves = 3, - persist = 0.6 - }, - y_min = 1, - y_max = y_max, - decoration = "mcl_flowers:"..name, - }) - end - - register_mgv6_flower("tulip_red", 436) - register_mgv6_flower("tulip_orange", 536) - register_mgv6_flower("tulip_pink", 636) - register_mgv6_flower("tulip_white", 736) - register_mgv6_flower("azure_bluet", 800) - register_mgv6_flower("dandelion", 8) - -- Allium is supposed to only appear in flower forest in MC. There are no flower forests in v6. - -- We compensate by making it slightly rarer in v6. - register_mgv6_flower("allium", 0, -0.001) - --[[ Blue orchid is supposed to appear in swamplands. There are no swamplands in v6. - We emulate swamplands by limiting the height to 5 levels above sea level, - which should be close to the water. ]] - register_mgv6_flower("blue_orchid", 64500, nil, mcl_worlds.layer_to_y(67)) - register_mgv6_flower("oxeye_daisy", 3490) - register_mgv6_flower("poppy", 9439) - - -- Put top snow on snowy grass blocks. The v6 mapgen does not generate the top snow on its own. - minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:grass_block_snow"}, - sidelen = 16, - fill_ratio = 11.0, -- complete coverage - y_min = 1, - y_max = mcl_vars.mg_overworld_max, - decoration = "mcl_core:snow", - }) - -end +dofile(modpath.."/ores.lua") local mg_flags = minetest.settings:get_flags("mg_flags") diff --git a/mods/MAPGEN/mcl_mapgen_core/ores.lua b/mods/MAPGEN/mcl_mapgen_core/ores.lua new file mode 100644 index 000000000..687e0ba41 --- /dev/null +++ b/mods/MAPGEN/mcl_mapgen_core/ores.lua @@ -0,0 +1,616 @@ +-- Diorite, andesite and granite +local specialstones = { "mcl_core:diorite", "mcl_core:andesite", "mcl_core:granite" } +for s=1, #specialstones do + local node = specialstones[s] + minetest.register_ore({ + ore_type = "blob", + ore = node, + wherein = {"mcl_core:stone"}, + clust_scarcity = 15*15*15, + clust_num_ores = 33, + clust_size = 5, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_vars.mg_overworld_max, + noise_params = { + offset = 0, + scale = 1, + spread = {x=250, y=250, z=250}, + seed = 12345, + octaves = 3, + persist = 0.6, + lacunarity = 2, + flags = "defaults", + } + }) + minetest.register_ore({ + ore_type = "blob", + ore = node, + wherein = {"mcl_core:stone"}, + clust_scarcity = 10*10*10, + clust_num_ores = 58, + clust_size = 7, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_vars.mg_overworld_max, + noise_params = { + offset = 0, + scale = 1, + spread = {x=250, y=250, z=250}, + seed = 12345, + octaves = 3, + persist = 0.6, + lacunarity = 2, + flags = "defaults", + } + }) +end + +local stonelike = {"mcl_core:stone", "mcl_core:diorite", "mcl_core:andesite", "mcl_core:granite"} + +-- Dirt +minetest.register_ore({ + ore_type = "blob", + ore = "mcl_core:dirt", + wherein = stonelike, + clust_scarcity = 15*15*15, + clust_num_ores = 33, + clust_size = 4, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_vars.mg_overworld_max, + noise_params = { + offset = 0, + scale = 1, + spread = {x=250, y=250, z=250}, + seed = 12345, + octaves = 3, + persist = 0.6, + lacunarity = 2, + flags = "defaults", + } +}) + +-- Gravel +minetest.register_ore({ + ore_type = "blob", + ore = "mcl_core:gravel", + wherein = stonelike, + clust_scarcity = 14*14*14, + clust_num_ores = 33, + clust_size = 5, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(111), + noise_params = { + offset = 0, + scale = 1, + spread = {x=250, y=250, z=250}, + seed = 12345, + octaves = 3, + persist = 0.6, + lacunarity = 2, + flags = "defaults", + } +}) + + +if minetest.settings:get_bool("mcl_generate_ores", true) then + -- + -- Coal + -- + + -- Common spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_coal", + wherein = stonelike, + clust_scarcity = 525*3, + clust_num_ores = 5, + clust_size = 3, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(50), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_coal", + wherein = stonelike, + clust_scarcity = 510*3, + clust_num_ores = 8, + clust_size = 3, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(50), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_coal", + wherein = stonelike, + clust_scarcity = 500*3, + clust_num_ores = 12, + clust_size = 3, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(50), + }) + + -- Medium-rare spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_coal", + wherein = stonelike, + clust_scarcity = 550*3, + clust_num_ores = 4, + clust_size = 2, + y_min = mcl_worlds.layer_to_y(51), + y_max = mcl_worlds.layer_to_y(80), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_coal", + wherein = stonelike, + clust_scarcity = 525*3, + clust_num_ores = 6, + clust_size = 3, + y_min = mcl_worlds.layer_to_y(51), + y_max = mcl_worlds.layer_to_y(80), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_coal", + wherein = stonelike, + clust_scarcity = 500*3, + clust_num_ores = 8, + clust_size = 3, + y_min = mcl_worlds.layer_to_y(51), + y_max = mcl_worlds.layer_to_y(80), + }) + + -- Rare spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_coal", + wherein = stonelike, + clust_scarcity = 600*3, + clust_num_ores = 3, + clust_size = 2, + y_min = mcl_worlds.layer_to_y(81), + y_max = mcl_worlds.layer_to_y(128), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_coal", + wherein = stonelike, + clust_scarcity = 550*3, + clust_num_ores = 4, + clust_size = 3, + y_min = mcl_worlds.layer_to_y(81), + y_max = mcl_worlds.layer_to_y(128), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_coal", + wherein = stonelike, + clust_scarcity = 500*3, + clust_num_ores = 5, + clust_size = 3, + y_min = mcl_worlds.layer_to_y(81), + y_max = mcl_worlds.layer_to_y(128), + }) + + -- + -- Iron + -- + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_iron", + wherein = stonelike, + clust_scarcity = 830, + clust_num_ores = 5, + clust_size = 3, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(39), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_iron", + wherein = stonelike, + clust_scarcity = 1660, + clust_num_ores = 4, + clust_size = 2, + y_min = mcl_worlds.layer_to_y(40), + y_max = mcl_worlds.layer_to_y(63), + }) + + -- + -- Gold + -- + + -- Common spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_gold", + wherein = stonelike, + clust_scarcity = 4775, + clust_num_ores = 5, + clust_size = 3, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(30), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_gold", + wherein = stonelike, + clust_scarcity = 6560, + clust_num_ores = 7, + clust_size = 3, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(30), + }) + + -- Rare spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_gold", + wherein = stonelike, + clust_scarcity = 13000, + clust_num_ores = 4, + clust_size = 2, + y_min = mcl_worlds.layer_to_y(31), + y_max = mcl_worlds.layer_to_y(33), + }) + + -- + -- Diamond + -- + + -- Common spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_diamond", + wherein = stonelike, + clust_scarcity = 10000, + clust_num_ores = 4, + clust_size = 3, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(12), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_diamond", + wherein = stonelike, + clust_scarcity = 5000, + clust_num_ores = 2, + clust_size = 2, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(12), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_diamond", + wherein = stonelike, + clust_scarcity = 10000, + clust_num_ores = 8, + clust_size = 3, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(12), + }) + + -- Rare spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_diamond", + wherein = stonelike, + clust_scarcity = 20000, + clust_num_ores = 1, + clust_size = 1, + y_min = mcl_worlds.layer_to_y(13), + y_max = mcl_worlds.layer_to_y(15), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_diamond", + wherein = stonelike, + clust_scarcity = 20000, + clust_num_ores = 2, + clust_size = 2, + y_min = mcl_worlds.layer_to_y(13), + y_max = mcl_worlds.layer_to_y(15), + }) + + -- + -- Ancient debris + -- + local ancient_debris_wherein = {"mcl_nether:netherrack","mcl_blackstone:blackstone","mcl_blackstone:basalt"} + -- Common spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_nether:ancient_debris", + wherein = ancient_debris_wherein, + clust_scarcity = 25000, -- 0.004% chance + clust_num_ores = 3, + clust_size = 3, + y_min = mcl_vars.mg_nether_min + 8, + y_max = mcl_vars.mg_nether_min + 22, + }) + + -- Rare spawn (below) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_nether:ancient_debris", + wherein = ancient_debris_wherein, + clust_scarcity = 32000, + clust_num_ores = 2, + clust_size = 3, + y_min = mcl_vars.mg_nether_min, + y_max = mcl_vars.mg_nether_min + 8, + }) + + -- Rare spawn (above) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_nether:ancient_debris", + wherein = ancient_debris_wherein, + clust_scarcity = 32000, + clust_num_ores = 2, + clust_size = 3, + y_min = mcl_vars.mg_nether_min + 22, + y_max = mcl_vars.mg_nether_min + 119, + }) + + -- + -- Redstone + -- + + -- Common spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_redstone", + wherein = stonelike, + clust_scarcity = 500, + clust_num_ores = 4, + clust_size = 3, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(13), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_redstone", + wherein = stonelike, + clust_scarcity = 800, + clust_num_ores = 7, + clust_size = 4, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(13), + }) + + -- Rare spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_redstone", + wherein = stonelike, + clust_scarcity = 1000, + clust_num_ores = 4, + clust_size = 3, + y_min = mcl_worlds.layer_to_y(13), + y_max = mcl_worlds.layer_to_y(15), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_redstone", + wherein = stonelike, + clust_scarcity = 1600, + clust_num_ores = 7, + clust_size = 4, + y_min = mcl_worlds.layer_to_y(13), + y_max = mcl_worlds.layer_to_y(15), + }) + + -- + -- Emerald + -- + + if mg_name == "v6" then + -- Generate everywhere in v6, but rarely. + + -- Common spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_emerald", + wherein = stonelike, + clust_scarcity = 14340, + clust_num_ores = 1, + clust_size = 1, + y_min = mcl_vars.mg_overworld_min, + y_max = mcl_worlds.layer_to_y(29), + }) + -- Rare spawn + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_emerald", + wherein = stonelike, + clust_scarcity = 21510, + clust_num_ores = 1, + clust_size = 1, + y_min = mcl_worlds.layer_to_y(30), + y_max = mcl_worlds.layer_to_y(32), + }) + end + + -- + -- Lapis Lazuli + -- + + -- Common spawn (in the center) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_lapis", + wherein = stonelike, + clust_scarcity = 10000, + clust_num_ores = 7, + clust_size = 4, + y_min = mcl_worlds.layer_to_y(14), + y_max = mcl_worlds.layer_to_y(16), + }) + + -- Rare spawn (below center) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_lapis", + wherein = stonelike, + clust_scarcity = 12000, + clust_num_ores = 6, + clust_size = 3, + y_min = mcl_worlds.layer_to_y(10), + y_max = mcl_worlds.layer_to_y(13), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_lapis", + wherein = stonelike, + clust_scarcity = 14000, + clust_num_ores = 5, + clust_size = 3, + y_min = mcl_worlds.layer_to_y(6), + y_max = mcl_worlds.layer_to_y(9), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_lapis", + wherein = stonelike, + clust_scarcity = 16000, + clust_num_ores = 4, + clust_size = 3, + y_min = mcl_worlds.layer_to_y(2), + y_max = mcl_worlds.layer_to_y(5), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_lapis", + wherein = stonelike, + clust_scarcity = 18000, + clust_num_ores = 3, + clust_size = 2, + y_min = mcl_worlds.layer_to_y(0), + y_max = mcl_worlds.layer_to_y(2), + }) + + -- Rare spawn (above center) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_lapis", + wherein = stonelike, + clust_scarcity = 12000, + clust_num_ores = 6, + clust_size = 3, + y_min = mcl_worlds.layer_to_y(17), + y_max = mcl_worlds.layer_to_y(20), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_lapis", + wherein = stonelike, + clust_scarcity = 14000, + clust_num_ores = 5, + clust_size = 3, + y_min = mcl_worlds.layer_to_y(21), + y_max = mcl_worlds.layer_to_y(24), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_lapis", + wherein = stonelike, + clust_scarcity = 16000, + clust_num_ores = 4, + clust_size = 3, + y_min = mcl_worlds.layer_to_y(25), + y_max = mcl_worlds.layer_to_y(28), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_lapis", + wherein = stonelike, + clust_scarcity = 18000, + clust_num_ores = 3, + clust_size = 2, + y_min = mcl_worlds.layer_to_y(29), + y_max = mcl_worlds.layer_to_y(32), + }) + minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:stone_with_lapis", + wherein = stonelike, + clust_scarcity = 32000, + clust_num_ores = 1, + clust_size = 1, + y_min = mcl_worlds.layer_to_y(31), + y_max = mcl_worlds.layer_to_y(32), + }) +end + +if not superflat then +-- Water and lava springs (single blocks of lava/water source) +-- Water appears at nearly every height, but not near the bottom +minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:water_source", + wherein = {"mcl_core:stone", "mcl_core:andesite", "mcl_core:diorite", "mcl_core:granite", "mcl_core:dirt"}, + clust_scarcity = 9000, + clust_num_ores = 1, + clust_size = 1, + y_min = mcl_worlds.layer_to_y(5), + y_max = mcl_worlds.layer_to_y(128), +}) + +-- Lava springs are rather common at -31 and below +minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:lava_source", + wherein = stonelike, + clust_scarcity = 2000, + clust_num_ores = 1, + clust_size = 1, + y_min = mcl_worlds.layer_to_y(1), + y_max = mcl_worlds.layer_to_y(10), +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:lava_source", + wherein = stonelike, + clust_scarcity = 9000, + clust_num_ores = 1, + clust_size = 1, + y_min = mcl_worlds.layer_to_y(11), + y_max = mcl_worlds.layer_to_y(31), +}) + +-- Lava springs will become gradually rarer with increasing height +minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:lava_source", + wherein = stonelike, + clust_scarcity = 32000, + clust_num_ores = 1, + clust_size = 1, + y_min = mcl_worlds.layer_to_y(32), + y_max = mcl_worlds.layer_to_y(47), +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:lava_source", + wherein = stonelike, + clust_scarcity = 72000, + clust_num_ores = 1, + clust_size = 1, + y_min = mcl_worlds.layer_to_y(48), + y_max = mcl_worlds.layer_to_y(61), +}) + +-- Lava may even appear above surface, but this is very rare +minetest.register_ore({ + ore_type = "scatter", + ore = "mcl_core:lava_source", + wherein = stonelike, + clust_scarcity = 96000, + clust_num_ores = 1, + clust_size = 1, + y_min = mcl_worlds.layer_to_y(62), + y_max = mcl_worlds.layer_to_y(127), +}) +end