mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
[mcl_biomes] Fix chorus random function, prevent chorus growth at return portal position
This commit is contained in:
parent
f3c540af5d
commit
f054eb1ce6
1 changed files with 9 additions and 5 deletions
|
@ -3974,14 +3974,18 @@ if mg_name ~= "singlenode" then
|
||||||
mcl_mapgen_core.register_generator("chorus_grow", nil, function(minp, maxp, blockseed)
|
mcl_mapgen_core.register_generator("chorus_grow", nil, function(minp, maxp, blockseed)
|
||||||
local gennotify = minetest.get_mapgen_object("gennotify")
|
local gennotify = minetest.get_mapgen_object("gennotify")
|
||||||
--local poslist = {}
|
--local poslist = {}
|
||||||
|
local pr = PseudoRandom(blockseed + 14)
|
||||||
for _, pos in ipairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do
|
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 x, y, z = pos.x, pos.y, pos.z
|
||||||
local node = minetest.get_node(realpos)
|
if x < -2 or x > 2 or z < -2 or z > 2 then
|
||||||
if node and node.name == "mcl_end:chorus_flower" then
|
local realpos = { x = x, y = y + 1, z = z }
|
||||||
mcl_end.grow_chorus_plant(realpos, node, PseudoRandom(blockseed + 14))
|
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
|
end
|
||||||
end, 999999999)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue