polishing

This commit is contained in:
kno10 2024-10-24 22:44:22 +02:00
parent 3799f61626
commit 38c333981f
6 changed files with 105 additions and 90 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
@ -149,7 +146,7 @@ mcl_mapgen_core.register_decoration({
height_max = 1,
place_offset_y = -1,
})
--rare CORAl easter egg
--rare CORAl easter egg (multicolored coral)
mcl_mapgen_core.register_decoration({
deco_type = "schematic",
place_on = {"group:sand", "mcl_core:gravel"},
@ -161,5 +158,8 @@ 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,
})

View File

@ -0,0 +1,72 @@
-- TODO: move to mcl_ocean?
local function register_kelp_decoration(offset, scale, biomes)
local surfaces = {"mcl_core:dirt", "mcl_core:sand", "mcl_core:gravel"}
local nodes = {"mcl_ocean:kelp_dirt", "mcl_ocean:kelp_sand", "mcl_ocean:kelp_gravel"}
for s = 1, #surfaces do
mcl_mapgen_core.register_decoration({
name = "Kelp on "..surfaces[s],
deco_type = "simple",
priority = 1500,
place_on = {surfaces[s]},
sidelen = 16,
noise_params = {
offset = offset,
scale = scale,
spread = vector.new(100, 100, 100),
seed = 32,
octaves = 3,
persist = 0.6,
},
biomes = biomes,
y_min = vl_biomes.DEEP_OCEAN_MIN,
y_max = -6,
decoration = nodes[s],
param2 = 16,
param2_max = 96, -- height * 16
place_offset_y = -1,
flags = "force_placement",
spawn_by = "mcl_core:water_source",
check_offset = 1,
num_spawn_by = 9,
})
end
end
-- TODO: use temperature classes, also to control amount?
register_kelp_decoration(-0.5, 1, {
"ExtremeHillsM_ocean",
"ExtremeHills+_ocean",
"MegaTaiga_ocean",
"MegaSpruceTaiga_ocean",
"Plains_ocean",
"SunflowerPlains_ocean",
"Forest_ocean",
"FlowerForest_ocean",
"BirchForest_ocean",
"BirchForestM_ocean",
"RoofedForest_ocean",
"Swampland_ocean",
"Jungle_ocean",
"JungleM_ocean",
"JungleEdge_ocean",
"JungleEdgeM_ocean",
"MushroomIsland_ocean",
"ExtremeHillsM_deep_ocean",
"ExtremeHills+_deep_ocean",
"MegaTaiga_deep_ocean",
"MegaSpruceTaiga_deep_ocean",
"Plains_deep_ocean",
"SunflowerPlains_deep_ocean",
"Forest_deep_ocean",
"FlowerForest_deep_ocean",
"BirchForest_deep_ocean",
"BirchForestM_deep_ocean",
"RoofedForest_deep_ocean",
"Swampland_deep_ocean",
"Jungle_deep_ocean",
"JungleM_deep_ocean",
"JungleEdge_deep_ocean",
"JungleEdgeM_deep_ocean",
"MushroomIsland_deep_ocean",
})

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

@ -27,6 +27,9 @@ local function register_seagrass_decoration(offset, scale, biomes)
param2_max = 3,
place_offset_y = -1,
flags = "force_placement",
spawn_by = "mcl_core:water_source",
check_offset = 1,
num_spawn_by = 9,
})
end
end
@ -104,71 +107,3 @@ register_seagrass_decoration(0, 0.5, {
"ColdTaiga_beach_water",
"ExtremeHills_beach",
})
local function register_kelp_decoration(offset, scale, biomes)
local surfaces = {"mcl_core:dirt", "mcl_core:sand", "mcl_core:gravel"}
local nodes = {"mcl_ocean:kelp_dirt", "mcl_ocean:kelp_sand", "mcl_ocean:kelp_gravel"}
for s = 1, #surfaces do
mcl_mapgen_core.register_decoration({
name = "Kelp on "..surfaces[s],
deco_type = "simple",
priority = 1500,
place_on = {surfaces[s]},
sidelen = 16,
noise_params = {
offset = offset,
scale = scale,
spread = vector.new(100, 100, 100),
seed = 32,
octaves = 3,
persist = 0.6,
},
biomes = biomes,
y_min = vl_biomes.DEEP_OCEAN_MIN,
y_max = -6,
decoration = nodes[s],
param2 = 16,
param2_max = 96, -- height * 16
place_offset_y = -1,
flags = "force_placement",
})
end
end
register_kelp_decoration(-0.5, 1, {
"ExtremeHillsM_ocean",
"ExtremeHills+_ocean",
"MegaTaiga_ocean",
"MegaSpruceTaiga_ocean",
"Plains_ocean",
"SunflowerPlains_ocean",
"Forest_ocean",
"FlowerForest_ocean",
"BirchForest_ocean",
"BirchForestM_ocean",
"RoofedForest_ocean",
"Swampland_ocean",
"Jungle_ocean",
"JungleM_ocean",
"JungleEdge_ocean",
"JungleEdgeM_ocean",
"MushroomIsland_ocean",
"ExtremeHillsM_deep_ocean",
"ExtremeHills+_deep_ocean",
"MegaTaiga_deep_ocean",
"MegaSpruceTaiga_deep_ocean",
"Plains_deep_ocean",
"SunflowerPlains_deep_ocean",
"Forest_deep_ocean",
"FlowerForest_deep_ocean",
"BirchForest_deep_ocean",
"BirchForestM_deep_ocean",
"RoofedForest_deep_ocean",
"Swampland_deep_ocean",
"Jungle_deep_ocean",
"JungleM_deep_ocean",
"JungleEdge_deep_ocean",
"JungleEdgeM_deep_ocean",
"MushroomIsland_deep_ocean",
})

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
@ -326,10 +327,11 @@ elseif mg_name ~= "v6" then
dofile(modpath.."/deco/corals.lua")
dofile(modpath.."/deco/fern.lua")
dofile(modpath.."/deco/flowers.lua")
dofile(modpath.."/deco/kelp.lua")
dofile(modpath.."/deco/mushrooms.lua")
dofile(modpath.."/deco/pumpkin.lua")
dofile(modpath.."/deco/reeds.lua")
dofile(modpath.."/deco/seagrass_kelp.lua")
dofile(modpath.."/deco/seagrass.lua")
dofile(modpath.."/deco/snowy_dirt.lua")
dofile(modpath.."/deco/sweet_berry.lua")
dofile(modpath.."/deco/tallgrass.lua")