summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua11
-rw-r--r--node_defs.lua6
2 files changed, 14 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 9c36883..0ac4562 100644
--- a/init.lua
+++ b/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
diff --git a/node_defs.lua b/node_defs.lua
index 724133f..c49cf7c 100644
--- a/node_defs.lua
+++ b/node_defs.lua
@@ -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")