diff --git a/mods/bg_tree/decompose.lua b/mods/bg_tree/decompose.lua index 2f0c569..42ccf44 100644 --- a/mods/bg_tree/decompose.lua +++ b/mods/bg_tree/decompose.lua @@ -64,9 +64,8 @@ blockgame.register_increasing_abm({ return data.value >= start_decompose_cost end, action = function (pos, node, data) - -- 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) + local def = minetest.registered_nodes[node.name] + local level = def.level minetest.set_node(pos, {name = leaves_decomposing .. "_" .. level}) end, })