diff --git a/mods/MAPGEN/mcl_mapgen_core/api.lua b/mods/MAPGEN/mcl_mapgen_core/api.lua index ca8727885..c474926f0 100644 --- a/mods/MAPGEN/mcl_mapgen_core/api.lua +++ b/mods/MAPGEN/mcl_mapgen_core/api.lua @@ -227,9 +227,15 @@ local function sort_decorations() if not deco_id then error("Failed to register decoration "..tostring(def.name).." - name not unique?") end - if def.gen_callback then - minetest.set_gen_notify({decoration = true}, {deco_id}) - gennotify_map["decoration#" .. deco_id] = def + if def.name then + deco_id = minetest.get_decoration_id(def.name) + if not deco_id then + error("Failed to register decoration "..tostring(def.name).." - name not unique?") + end + if def.gen_callback then + minetest.set_gen_notify({decoration = true}, {deco_id}) + gennotify_map["decoration#" .. deco_id] = def + end end end pending_decorations = nil -- as we will not run again diff --git a/mods/MAPGEN/vl_biomes/deco/corals.lua b/mods/MAPGEN/vl_biomes/deco/corals.lua index cfdec72c1..65e116e94 100644 --- a/mods/MAPGEN/vl_biomes/deco/corals.lua +++ b/mods/MAPGEN/vl_biomes/deco/corals.lua @@ -2,7 +2,9 @@ local mod_mcl_structures = minetest.get_modpath("mcl_structures") local coral_min = vl_biomes.OCEAN_MIN local coral_max = -10 -local warm_oceans = vl_biomes.by_water_temp.warm +local warm_oceans = table.copy(vl_biomes.by_water_temp.warm) +for _, v in ipairs(vl_biomes.by_water_temp.lukewarm) do table.insert(warm_oceans, v) end +--minetest.log("action", "Warm oceans: "..dump(warm_oceans,"")) -- Coral Reefs for _, c in ipairs({ "brain", "horn", "bubble", "tube", "fire" }) do @@ -27,6 +29,9 @@ for _, c in ipairs({ "brain", "horn", "bubble", "tube", "fire" }) do schematic = mod_mcl_structures .. "/schematics/mcl_structures_coral_" .. c .. "_1.mts", rotation = "random", flags = "all_floors,force_placement", + spawn_by = "mcl_core:water_source", + check_offset = 1, + num_spawn_by = 12, }) mcl_mapgen_core.register_decoration({ deco_type = "schematic", @@ -39,6 +44,9 @@ for _, c in ipairs({ "brain", "horn", "bubble", "tube", "fire" }) do schematic = mod_mcl_structures .. "/schematics/mcl_structures_coral_" .. c .. "_2.mts", rotation = "random", flags = "all_floors,force_placement", + spawn_by = "mcl_core:water_source", + check_offset = 1, + num_spawn_by = 12, }) mcl_mapgen_core.register_decoration({ @@ -52,20 +60,9 @@ for _, c in ipairs({ "brain", "horn", "bubble", "tube", "fire" }) do biomes = warm_oceans, flags = "force_placement, all_floors", height = 1, - height_max = 1, - }) - mcl_mapgen_core.register_decoration({ - deco_type = "simple", - place_on = {"mcl_ocean:horn_coral_block"}, - sidelen = 16, - fill_ratio = 7, - y_min = coral_min, - y_max = coral_max, - decoration = "mcl_ocean:" .. c .. "_coral_fan", - biomes = warm_oceans, - flags = "force_placement, all_floors", - height = 1, - height_max = 1, + spawn_by = "mcl_core:water_source", + check_offset = 1, + num_spawn_by = 12, }) end @@ -161,5 +158,10 @@ mcl_mapgen_core.register_decoration({ schematic = mod_mcl_structures .. "/schematics/coral_cora.mts", rotation = "random", flags = "all_floors,force_placement", + spawn_by = "mcl_core:water_source", + check_offset = 1, + num_spawn_by = 12, + name = "CORAl", + gen_callback = function(pos) minetest.log("action", "CORAl at ".. dump(pos, "")) end }) diff --git a/mods/MAPGEN/vl_biomes/deco/reeds.lua b/mods/MAPGEN/vl_biomes/deco/reeds.lua index 28042dc1a..62cef60ad 100644 --- a/mods/MAPGEN/vl_biomes/deco/reeds.lua +++ b/mods/MAPGEN/vl_biomes/deco/reeds.lua @@ -17,7 +17,7 @@ for _, biome in ipairs(vl_biomes.overworld_biomes) do decoration = "mcl_core:reeds", height = 1, height_max = 3, - spawn_by = {"mcl_core:water_source", "mcl_core:river_water_source", "group:frosted_ice"}, + spawn_by = {"mcl_core:water_source", "mclx_core:river_water_source", "group:frosted_ice"}, num_spawn_by = 1, biomes = {biome}, param2 = biome._mcl_foliage_palette_index diff --git a/mods/MAPGEN/vl_biomes/init.lua b/mods/MAPGEN/vl_biomes/init.lua index d9b2c8aee..77674158e 100644 --- a/mods/MAPGEN/vl_biomes/init.lua +++ b/mods/MAPGEN/vl_biomes/init.lua @@ -87,6 +87,7 @@ vl_biomes.register_biome = function(def) if def._ocean then local odef = def._ocean if odef._mcl_skycolor == nil then odef._mcl_skycolor = vl_biomes.ocean_skycolor end + if odef._mcl_water_temp == nil and def._mcl_water_temp then odef._mcl_water_temp = def._mcl_water_temp end if odef._mcl_water_temp == nil or odef._mcl_water_temp == "default" then odef._mcl_water_temp = "ocean" end if odef._mcl_waterfogcolor == nil then odef._mcl_waterfogcolor = waterfogcolor[odef._mcl_water_temp] end if odef.y_min == nil and not odef.min_pos then odef.y_min = vl_biomes.OCEAN_MIN end @@ -146,7 +147,7 @@ vl_biomes.register_biome = function(def) -- build a biome map based on water temperature if k == "_ocean" and sdef._mcl_water_temp then local temp = sdef._mcl_water_temp - if not vl_biomes.by_water_temp[temp] then vl_biomes.by_water_temp[temp] = {} end + if vl_biomes.by_water_temp[temp] == nil then vl_biomes.by_water_temp[temp] = {} end table.insert(vl_biomes.by_water_temp[temp], sdef.name) end end