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.
This commit is contained in:
parent
19e392d1f3
commit
bdfb9f5fda
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue