added {can_bonemeal=1} group for special node usage

This commit is contained in:
TenPlus1 2019-03-07 16:38:42 +00:00
parent a4c4716c36
commit cff3fc378b
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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