From bdfb9f5fda140ebd74103b24d40537e05623631d Mon Sep 17 00:00:00 2001 From: trans_soup <> Date: Thu, 19 Oct 2023 15:12:36 +0200 Subject: [PATCH] make leaves only grow sideways. previously, living leaves grew into more living leaves in all 6 directions. now, they only grow in the 4 horizontal directions. --- mods/bg_tree/grow_leaves.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/bg_tree/grow_leaves.lua b/mods/bg_tree/grow_leaves.lua index 62d3931..44313c9 100644 --- a/mods/bg_tree/grow_leaves.lua +++ b/mods/bg_tree/grow_leaves.lua @@ -24,8 +24,8 @@ blockgame.register_abm({ local distance = meta:get_int("leaf_distance") or 1 if distance >= max_grow_distance then return end - local neighbors = blockgame.vector.get_neighbors(pos) - for _, target in pairs(neighbors) do + local sides = blockgame.vector.get_sides_of(pos) + for _, target in pairs(sides) do if blockgame.chance(2) then blockgame.attempt_place(target, {name = leaves_growing}) minetest.get_meta(target):set_int("leaf_distance", distance + 1)