make leaves get a random level when they start decomposing.
This commit is contained in:
parent
7493d9771c
commit
737afdfcc9
|
@ -23,7 +23,10 @@ blockgame.register_increasing_abm({
|
|||
return data.value >= 80
|
||||
end,
|
||||
action = function (pos, node, data)
|
||||
minetest.set_node(pos, {name = leaves_decomposing})
|
||||
-- NOTE: might wanna access the 4 from somewhere, instead of directly knowing it.
|
||||
-- that way this won't have to change if decomposing leaves max levels change.
|
||||
local level = math.random(1, 4)
|
||||
minetest.set_node(pos, {name = leaves_decomposing .. "_" .. level})
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue