From 4c198fad78428ac7695626fc39cf6db63d25c7d3 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sun, 7 Apr 2013 22:09:18 -0400 Subject: Multiple changes, see below: Fix replacement of default trees so that it works correctly. Beeches now use default tree nodes, but L-systems models. This redefines the default tree, wood, leaves, and saplings so that they use moretrees' textures "Beech" in their descriptions, but only if replacement of default trees is enabled. Added backward-compat aliases for this change. Moved tree replacement mapgen->air aliases to a more logical spot in the code. Also, changed out all leaf decay dig_node() calls for nodeupdate(), since the former calls the latter anyway, and the latter is what does the job. Increased the palm leaf decay radius to 12. --- leafdecay.lua | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'leafdecay.lua') diff --git a/leafdecay.lua b/leafdecay.lua index 174eb34..7c75f11 100644 --- a/leafdecay.lua +++ b/leafdecay.lua @@ -11,7 +11,7 @@ if moretrees.enable_leafdecay then action = function(pos, node, active_object_count, active_object_count_wider) if not minetest.env:find_node_near(pos, moretrees.leafdecay_radius, "moretrees:"..treename.."_trunk") then minetest.env:remove_node(pos) - minetest.env:dig_node(pos) + nodeupdate(pos) end end }) @@ -25,7 +25,7 @@ if moretrees.enable_leafdecay then action = function(pos, node, active_object_count, active_object_count_wider) if not minetest.env:find_node_near(pos, moretrees.leafdecay_radius, {"default:jungletree", "moretrees:jungletree_trunk"}) then minetest.env:remove_node(pos) - minetest.env:dig_node(pos) + nodeupdate(pos) end end }) @@ -37,7 +37,7 @@ if moretrees.enable_leafdecay then action = function(pos, node, active_object_count, active_object_count_wider) if not minetest.env:find_node_near(pos, moretrees.leafdecay_radius, "moretrees:fir_trunk") then minetest.env:remove_node(pos) - minetest.env:dig_node(pos) + nodeupdate(pos) end end }) @@ -49,19 +49,13 @@ if moretrees.enable_leafdecay then action = function(pos, node, active_object_count, active_object_count_wider) if not minetest.env:find_node_near(pos, moretrees.palm_leafdecay_radius, "moretrees:palm_trunk") then minetest.env:remove_node(pos) - minetest.env:dig_node(pos) + nodeupdate(pos) end end }) end -if moretrees.enable_replace_default_trees then - minetest.register_alias("mapgen_tree", "air") - minetest.register_alias("mapgen_leaves", "air") - minetest.register_alias("mapgen_apple", "air") - plantslib:register_generate_plant(moretrees.beech_biome, moretrees.beech_model) - -elseif moretrees.enable_default_leafdecay then +if moretrees.enable_default_leafdecay then minetest.register_abm({ nodenames = "default:leaves", interval = moretrees.default_leafdecay_delay, @@ -69,7 +63,7 @@ elseif moretrees.enable_default_leafdecay then action = function(pos, node, active_object_count, active_object_count_wider) if not minetest.env:find_node_near(pos, moretrees.default_leafdecay_radius, {"default:tree"}) then minetest.env:remove_node(pos) - minetest.env:dig_node(pos) + nodeupdate(pos) end end }) -- cgit v1.2.3