Phased out all deprecated minetest.env:* uses in favor of minetest.*
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Mon, 1 Jul 2013 03:55:07 +0000 (23:55 -0400)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Mon, 1 Jul 2013 03:55:07 +0000 (23:55 -0400)
init.lua
leafdecay.lua
node_defs.lua

index 3f31a3bb8bff595be399cebfc1e2b50410e2e91f..c0a2aaaedc9bd6f980fd39482d2024f49d489e41 100644 (file)
--- 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)")
index 7c75f1159a938aaf47d2362ad6cd6f09e3368094..be22ba4f680c24eae4af87b3a795d1ae42d71131 100644 (file)
@@ -9,8 +9,8 @@ if moretrees.enable_leafdecay then
                                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
@@ -23,8 +23,8 @@ if moretrees.enable_leafdecay then
                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
@@ -35,8 +35,8 @@ if moretrees.enable_leafdecay then
                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
@@ -47,8 +47,8 @@ if moretrees.enable_leafdecay then
                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
@@ -61,8 +61,8 @@ if moretrees.enable_default_leafdecay then
                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
index 651e0cff73a84c5a994c6548ab148c9d6c3c3162..281a71fe0f0eda0e73dcbec6fa856754b21b6f3a 100644 (file)
@@ -143,7 +143,7 @@ for i in ipairs(moretrees.treelist) do
                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,
        })
 
@@ -239,7 +239,7 @@ minetest.register_abm({
        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,
 })