1
0
Fork 0

[mapgen] temporarily delay chorus nodes grow

mapgen
kay27 2021-04-26 04:09:14 +04:00
parent abc3a1f139
commit 942d70ee62
3 changed files with 15 additions and 10 deletions

View File

@ -3971,13 +3971,14 @@ if mg_name ~= "singlenode" then
-- Overworld decorations for v6 are handled in mcl_mapgen_core
if deco_id_chorus_plant then
mcl_mapgen_core.register_generator("chorus_grow", nil, function(minp, maxp, blockseed)
local gennotify = minetest.get_mapgen_object("gennotify")
--local poslist = {}
for _, pos in ipairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do
mcl_mapgen.register_chunk_generator_lvm(function(c)
c.gennotify = c.gennotify or minetest.get_mapgen_object("gennotify")
local gennotify = c.gennotify
for _, pos in pairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do
local realpos = { x = pos.x, y = pos.y + 1, z = pos.z }
mcl_end.grow_chorus_plant(realpos)
minetest.after(1, mcl_end.grow_chorus_plant, realpos)
end
return c
end)
end

View File

@ -416,4 +416,4 @@ function mcl_dungeons.spawn_dungeon(p1, _, pr)
emerge_area(p1, p2, ecb_spawn_dungeon, {p1=p1, p2=p2, dim=dim, pr=pr, dontcheck=true})
end
mcl_mapgen_core.register_generator("dungeons", nil, dungeons_nodes, 999999)
mcl_mapgen.register_chunk_generator(dungeons_nodes, 999999)

View File

@ -1890,8 +1890,11 @@ local function set_layers(data, area, content_id, check, min, max, minp, maxp, l
end
-- Below the bedrock, generate air/void
local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed)
local biomemap --ymin, ymax
local function basic(c)
local vm, data, emin, emax, area, minp, maxp, blockseed = c.vm, c.data, c.emin, c.emax, c.area, c.minp, c.maxp, c.blockseed
c.data2 = c.data2 or vm:get_data_param2(lvm_buffer_param2)
local data2 = c.data2
local lvm_used = false
local pr = PseudoRandom(blockseed)
@ -1935,7 +1938,8 @@ local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed)
-- Clay, vines, cocoas
lvm_used = generate_clay(minp, maxp, blockseed, data, area, lvm_used)
biomemap = minetest.get_mapgen_object("biomemap")
c.biomemap = c.biomemap or minetest.get_mapgen_object("biomemap")
lvm_used = generate_tree_decorations(minp, maxp, blockseed, data, data2, area, biomemap, lvm_used, pr)
----- Interactive block fixing section -----
@ -2098,5 +2102,5 @@ local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed)
return lvm_used, shadow
end
mcl_mapgen_core.register_generator("main", basic, nil, 1, true)
mcl_mapgen.register_chunk_generator_lvm(basic, 1)