summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-06-30 23:55:07 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-06-30 23:55:07 -0400
commitc277590fc2159a6a3599272e8320f600879a75ec (patch)
treecb6b63a8941743447f5b2f236b4c970b4b087646 /init.lua
parent9e2c0485f4ab9aaab13f7b69c84e39049dd6523b (diff)
Phased out all deprecated minetest.env:* uses in favor of minetest.*
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua36
1 files changed, 18 insertions, 18 deletions
diff --git a/init.lua b/init.lua
index 3f31a3b..c0a2aaa 100644
--- a/init.lua
+++ b/init.lua
@@ -115,22 +115,22 @@ end
-- 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
@@ -180,12 +180,12 @@ function moretrees:grow_jungletree(pos)
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
@@ -207,12 +207,12 @@ function moretrees:grow_fir(pos)
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
@@ -234,12 +234,12 @@ function moretrees:grow_fir_snow(pos)
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)")