forked from mtcontrib/moretrees
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:
parent
8276d82bac
commit
ba170ee66e
11
init.lua
11
init.lua
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue
Block a user