polishing

This commit is contained in:
kno10 2024-10-24 22:44:22 +02:00
parent 6577f54736
commit b0481c2df5
4 changed files with 29 additions and 20 deletions

View File

@ -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

View File

@ -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
})

View File

@ -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

View File

@ -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