use clone-node method to redefine apple

(only way to add a new group item, for compat with rubenwardy's food mod)
This commit is contained in:
Vanessa Ezekowitz 2015-07-30 09:42:47 -04:00
parent 8276d82bac
commit ba170ee66e
2 changed files with 14 additions and 3 deletions

View File

@ -52,6 +52,17 @@ else
end
moretrees.intllib = S
-- clone node
function moretrees.clone_node(name)
local node2 = {}
local node = minetest.registered_nodes[name]
for k,v in pairs(node) do
node2[k]=v
end
return node2
end
-- infinite stacks checking
if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then

View File

@ -374,9 +374,9 @@ minetest.register_node("moretrees:fir_leaves_bright", {
})
if moretrees.enable_redefine_apple then
minetest.override_item("default:apple",
{groups = { fleshy=3, dig_immediate=3, flammable=2, leafdecay=3, leafdecay_drop=1, attached_node = 1}
})
local appledef = moretrees.clone_node("default:apple")
appledef.groups.attached_node = 1
minetest.register_node(":default:apple", appledef)
end
table.insert(moretrees.avoidnodes, "default:jungletree")