From cff3fc378b8c348075c9d36e8a6e1406bea0dda2 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Thu, 7 Mar 2019 16:38:42 +0000 Subject: [PATCH] added {can_bonemeal=1} group for special node usage --- README.md | 1 + init.lua | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2f0e542..6ad15a9 100644 --- a/README.md +++ b/README.md @@ -30,5 +30,6 @@ Changelog: - 0.8 - Added support for farming redo's new garlic, pepper and onion crops - 0.9 - Added support for farming redo's pea and beetroot crops, checks for place_param - 1.0 - add_deco() now adds to existing item list while set_deco() replaces item list (thanks h-v-smacker) +- 1.1 - Added {can_bonemeal=1} group for special nodes Lucky Blocks: 6 diff --git a/init.lua b/init.lua index 85ddd2a..44580f1 100644 --- a/init.lua +++ b/init.lua @@ -213,7 +213,7 @@ local function check_soil(pos, nodename, strength) -- set radius according to strength local side = strength - 1 local tall = math.max(strength - 2, 0) - local floor = {"group:soil", "group:sand"} + local floor local groups = minetest.registered_items[nodename] and minetest.registered_items[nodename].groups or {} @@ -222,6 +222,8 @@ local function check_soil(pos, nodename, strength) floor = {"group:soil"} elseif groups.sand then floor = {"group:sand"} + else + floor = {nodename} end -- get area of land with free space above @@ -417,7 +419,8 @@ function bonemeal:on_use(pos, strength, node) -- grow grass and flowers if minetest.get_item_group(node.name, "soil") > 0 - or minetest.get_item_group(node.name, "sand") > 0 then + or minetest.get_item_group(node.name, "sand") > 0 + or minetest.get_item_group(node.name, "can_bonemeal") > 0 then check_soil(pos, node.name, strength) return end