0
0
Fork 0

[mcl_biomes] Fix chorus random function, prevent chorus growth at return portal position

This commit is contained in:
kay27 2021-05-10 02:47:56 +04:00
parent f3c540af5d
commit f054eb1ce6
1 changed files with 9 additions and 5 deletions

View File

@ -3974,14 +3974,18 @@ if mg_name ~= "singlenode" then
mcl_mapgen_core.register_generator("chorus_grow", nil, function(minp, maxp, blockseed)
local gennotify = minetest.get_mapgen_object("gennotify")
--local poslist = {}
local pr = PseudoRandom(blockseed + 14)
for _, pos in ipairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do
local realpos = { x = pos.x, y = pos.y + 1, z = pos.z }
local node = minetest.get_node(realpos)
if node and node.name == "mcl_end:chorus_flower" then
mcl_end.grow_chorus_plant(realpos, node, PseudoRandom(blockseed + 14))
local x, y, z = pos.x, pos.y, pos.z
if x < -2 or x > 2 or z < -2 or z > 2 then
local realpos = { x = x, y = y + 1, z = z }
local node = minetest.get_node(realpos)
if node and node.name == "mcl_end:chorus_flower" then
mcl_end.grow_chorus_plant(realpos, node, pr)
end
end
end
end, 999999999)
end)
end
end