From f054eb1ce60a653db9dc9a2bbe6cf8d8a8be619b Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 10 May 2021 02:47:56 +0400 Subject: [PATCH] [mcl_biomes] Fix chorus random function, prevent chorus growth at return portal position --- mods/MAPGEN/mcl_biomes/init.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index cf9ccfb9e9..3655be7ebe 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -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