Fix food_apple group for apple if overwritten by moretrees

This commit is contained in:
philipmi 2022-01-04 11:58:51 +01:00
parent 2be4ed8f8a
commit 802ddb35e4
2 changed files with 7 additions and 5 deletions

View file

@ -8,7 +8,7 @@ This mod causes fruits on trees from other mods to regrow like apples in the 5.0
Cool_trees modpack, ethereal, farming_plus and moretrees are supported, but maybe there are other mods with this problem that I don't know about. Please tell me in the Minetest Forum topic!
Apples in older versions than Minetest 5.0 will also regrow.
Default apples in older versions than Minetest 5.0 will also regrow.
Credits
----

View file

@ -43,7 +43,11 @@ local add_fruit_regrowable = function(fruit, node, leaves)
local groups = node.groups
if minetest.get_item_group(node, "attached_node") == 1 then
groups = {fleshy=3, dig_immediate=3, flammable=2, leafdecay = 1, leafdecay_drop = 1}
if node == "default:apple" then
groups = {fleshy = 3, dig_immediate = 3, flammable = 2, leafdecay = 3, leafdecay_drop = 1, food_apple = 1}
else
groups = {fleshy=3, dig_immediate=3, flammable=2, leafdecay = 1, leafdecay_drop = 1}
end
end
-- override fruit
@ -84,10 +88,8 @@ local add_fruit_regrowable = function(fruit, node, leaves)
minetest.remove_node(pos)
elseif minetest.get_node_light(pos) < 13 then
minetest.get_node_timer(pos):start(200)
elseif node == "cacaotree:pod" or node == "plumtree:plum" then
minetest.set_node(pos, {name = node, param2 = minetest.get_node(pos).param2})
else
minetest.set_node(pos, {name = node})
minetest.set_node(pos, {name = node, param2 = minetest.get_node(pos).param2})
end
end
})