mapgen/mcl_mapgen_core: move set_node decorations a node callback

During the rewrite in 89e55e9065, a queue system was added to allow
using both VoxelManip-based generation steps, and set_node-based steps,
however some set_node-based steps (underground mushrooms, nether
decorations, and structures) were missed and remained in a VoxelManip
step. The result is that the changes made by the set_node stages were
overwritten after the (now-stale) VoxelManip data was committed later.

(ref. Mineclonia/Mineclonia#26)
This commit is contained in:
E 2021-04-20 00:41:10 -04:00
parent 357024ad97
commit 2381cb8e84

View file

@ -2207,17 +2207,19 @@ local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed)
lvm_used = true
end
return lvm_used, shadow
end
local function basic_node(minp, maxp, blockseed)
if mg_name ~= "singlenode" then
-- Generate special decorations
generate_underground_mushrooms(minp, maxp, blockseed)
generate_nether_decorations(minp, maxp, blockseed)
generate_structures(minp, maxp, blockseed, biomemap)
generate_structures(minp, maxp, blockseed, minetest.get_mapgen_object("biomemap"))
end
return lvm_used, shadow
end
mcl_mapgen_core.register_generator("main", basic, nil, 1, true)
mcl_mapgen_core.register_generator("main", basic, basic_node, 1, true)
-- "Trivial" (actually NOT) function to just read the node and some stuff to not just return "ignore", like 5.3.0 does.
-- p: Position, if it's wrong, {name="error"} node will return.