diff --git a/mods/bg_tree/grow_sapling.lua b/mods/bg_tree/grow_sapling.lua index f9e53c5..1d3a948 100644 --- a/mods/bg_tree/grow_sapling.lua +++ b/mods/bg_tree/grow_sapling.lua @@ -9,8 +9,10 @@ local leaves_growing = modname .. ":leaves_growing" local function supports_sapling (name) - if name == log_alive or name == root_alive then return true end - return minetest.get_item_group(name, "dirty") > 0 + return blockgame.item_matches(name, { + "group:supports_sapling", + "group:dirty", + }) end -- this commented-out function will be used when roots start affecting tree growth. @@ -39,7 +41,7 @@ blockgame.register_increasing_abm({ id = modname .. ":grow_sapling", label = "grow sapling", nodenames = {sapling}, - neighbors = {"group:dirty", log_alive}, + neighbors = {"group:supports_sapling", "group:dirty"}, interval = 15, chance = 4, rate = function (pos, node, data) diff --git a/mods/bg_tree/node.lua b/mods/bg_tree/node.lua index c79947e..33ca3f3 100644 --- a/mods/bg_tree/node.lua +++ b/mods/bg_tree/node.lua @@ -19,6 +19,7 @@ blockgame.register_node("root_alive", { description = "Growing Root", groups = { woody = 1, + supports_sapling = 1, }, drop = modname .. ":root", }) diff --git a/mods/bg_tree/node_log.lua b/mods/bg_tree/node_log.lua index 421d947..ba522be 100644 --- a/mods/bg_tree/node_log.lua +++ b/mods/bg_tree/node_log.lua @@ -28,6 +28,7 @@ reg_log("log", { reg_log("log_alive", { groups = { planty = 1, + supports_sapling = 1, }, texture = "log", drop = modname .. ":log",