-- Code to spawn a birch tree
function moretrees:grow_birch(pos)
- minetest.env:remove_node(pos)
+ minetest.remove_node(pos)
if math.random(1,2) == 1 then
- minetest.env:spawn_tree(pos, moretrees.birch_model1)
+ minetest.spawn_tree(pos, moretrees.birch_model1)
else
- minetest.env:spawn_tree(pos, moretrees.birch_model2)
+ minetest.spawn_tree(pos, moretrees.birch_model2)
end
end
-- Code to spawn a spruce tree
function moretrees:grow_spruce(pos)
- minetest.env:remove_node(pos)
+ minetest.remove_node(pos)
if math.random(1,2) == 1 then
- minetest.env:spawn_tree(pos, moretrees.spruce_model1)
+ minetest.spawn_tree(pos, moretrees.spruce_model1)
else
- minetest.env:spawn_tree(pos, moretrees.spruce_model2)
+ minetest.spawn_tree(pos, moretrees.spruce_model2)
end
end
moretrees.jungletree_model.rules_b = moretrees.jt_rules_b2
end
- minetest.env:remove_node(pos)
- local leaves = minetest.env:find_nodes_in_area({x = pos.x-1, y = pos.y, z = pos.z-1}, {x = pos.x+1, y = pos.y+10, z = pos.z+1}, "default:leaves")
+ minetest.remove_node(pos)
+ local leaves = minetest.find_nodes_in_area({x = pos.x-1, y = pos.y, z = pos.z-1}, {x = pos.x+1, y = pos.y+10, z = pos.z+1}, "default:leaves")
for leaf in ipairs(leaves) do
- minetest.env:remove_node(leaves[leaf])
+ minetest.remove_node(leaves[leaf])
end
- minetest.env:spawn_tree(pos, moretrees.jungletree_model)
+ minetest.spawn_tree(pos, moretrees.jungletree_model)
end
-- code to spawn fir trees
moretrees.fir_model.iterations = 7
moretrees.fir_model.random_level = 5
- minetest.env:remove_node(pos)
- local leaves = minetest.env:find_nodes_in_area({x = pos.x, y = pos.y, z = pos.z}, {x = pos.x, y = pos.y+5, z = pos.z}, "default:leaves")
+ minetest.remove_node(pos)
+ local leaves = minetest.find_nodes_in_area({x = pos.x, y = pos.y, z = pos.z}, {x = pos.x, y = pos.y+5, z = pos.z}, "default:leaves")
for leaf in ipairs(leaves) do
- minetest.env:remove_node(leaves[leaf])
+ minetest.remove_node(leaves[leaf])
end
- minetest.env:spawn_tree(pos,moretrees.fir_model)
+ minetest.spawn_tree(pos,moretrees.fir_model)
end
-- same thing, but a smaller version that grows only in snow biomes
moretrees.fir_model.iterations = 2
moretrees.fir_model.random_level = 2
- minetest.env:remove_node(pos)
- local leaves = minetest.env:find_nodes_in_area({x = pos.x, y = pos.y, z = pos.z}, {x = pos.x, y = pos.y+5, z = pos.z}, "default:leaves")
+ minetest.remove_node(pos)
+ local leaves = minetest.find_nodes_in_area({x = pos.x, y = pos.y, z = pos.z}, {x = pos.x, y = pos.y+5, z = pos.z}, "default:leaves")
for leaf in ipairs(leaves) do
- minetest.env:remove_node(leaves[leaf])
+ minetest.remove_node(leaves[leaf])
end
- minetest.env:spawn_tree(pos,moretrees.fir_model)
+ minetest.spawn_tree(pos,moretrees.fir_model)
end
print("[Moretrees] Loaded (2013-02-11)")
interval = moretrees.leafdecay_delay,
chance = moretrees.leafdecay_chance,
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)
+ if not minetest.find_node_near(pos, moretrees.leafdecay_radius, "moretrees:"..treename.."_trunk") then
+ minetest.remove_node(pos)
nodeupdate(pos)
end
end
interval = moretrees.leafdecay_delay,
chance = moretrees.leafdecay_chance,
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)
+ if not minetest.find_node_near(pos, moretrees.leafdecay_radius, {"default:jungletree", "moretrees:jungletree_trunk"}) then
+ minetest.remove_node(pos)
nodeupdate(pos)
end
end
interval = moretrees.leafdecay_delay,
chance = moretrees.leafdecay_chance,
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)
+ if not minetest.find_node_near(pos, moretrees.leafdecay_radius, "moretrees:fir_trunk") then
+ minetest.remove_node(pos)
nodeupdate(pos)
end
end
interval = moretrees.leafdecay_delay,
chance = moretrees.leafdecay_chance,
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)
+ if not minetest.find_node_near(pos, moretrees.palm_leafdecay_radius, "moretrees:palm_trunk") then
+ minetest.remove_node(pos)
nodeupdate(pos)
end
end
interval = moretrees.default_leafdecay_delay,
chance = moretrees.default_leafdecay_chance,
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)
+ if not minetest.find_node_near(pos, moretrees.default_leafdecay_radius, {"default:tree"}) then
+ minetest.remove_node(pos)
nodeupdate(pos)
end
end
action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2 or 0
nfdir = dirs2[fdir+1]
- minetest.env:add_node(pos, {name = "moretrees:"..treename.."_trunk", param2 = nfdir})
+ minetest.add_node(pos, {name = "moretrees:"..treename.."_trunk", param2 = nfdir})
end,
})
action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2 or 0
nfdir = dirs2[fdir+1]
- minetest.env:add_node(pos, {name = "moretrees:rubber_tree_trunk_empty", param2 = nfdir})
+ minetest.add_node(pos, {name = "moretrees:rubber_tree_trunk_empty", param2 = nfdir})
end,
})