summaryrefslogtreecommitdiff
path: root/mesecons_movestones/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'mesecons_movestones/init.lua')
-rw-r--r--mesecons_movestones/init.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/mesecons_movestones/init.lua b/mesecons_movestones/init.lua
index 0e497d2..4af892d 100644
--- a/mesecons_movestones/init.lua
+++ b/mesecons_movestones/init.lua
@@ -64,7 +64,7 @@ minetest.register_entity("mesecons_movestones:movestone_entity", {
local direction=mesecon:get_movestone_direction(pos)
if not direction then
- minetest.env:add_node(pos, {name="mesecons_movestones:movestone"})
+ minetest.env:place_node(pos, {name="mesecons_movestones:movestone"})
self.object:remove()
return
end
@@ -75,13 +75,13 @@ minetest.register_entity("mesecons_movestones:movestone_entity", {
if lnode.name ~= "ignore" and lnode.name ~= "air" and lnode.name ~= "default:water" and lnode.name ~= "default:water_flowing" then
local newnode
repeat
- minetest.env:remove_node(pos)
+ minetest.env:dig_node(pos)
pos.x=pos.x+direction.x
pos.y=pos.y+direction.y
pos.z=pos.z+direction.z
newnode = {name=lnode.name}
lnode = minetest.env:get_node(pos)
- minetest.env:add_node(pos, newnode)
+ minetest.env:place_node(pos, newnode)
nodeupdate(pos)
until lnode.name == "ignore" or lnode.name == "air" or lnode.name == "default:water" or lnode.name == "default:water_flowing"
end
@@ -113,7 +113,7 @@ mesecon:register_on_signal_on(function (pos, node)
or checknode.name=="ignore"
or checknode.name=="default:water"
or checknode.name=="default:water_flowing"
- minetest.env:remove_node(pos)
+ minetest.env:dig_node(pos)
nodeupdate(pos)
minetest.env:add_entity(pos, "mesecons_movestones:movestone_entity")
end
@@ -160,7 +160,7 @@ minetest.register_entity("mesecons_movestones:sticky_movestone_entity", {
if not direction then
--or (minetest.env:get_node_or_nil(pos).name ~="air"
--and minetest.env:get_node_or_nil(pos).name ~= nil) then
- minetest.env:add_node(pos, {name="mesecons_movestones:sticky_movestone"})
+ minetest.env:place_node(pos, {name="mesecons_movestones:sticky_movestone"})
self.object:remove()
return
end
@@ -176,13 +176,13 @@ minetest.register_entity("mesecons_movestones:sticky_movestone_entity", {
if lnode.name ~= "ignore" and lnode.name ~= "air" and lnode.name ~= "default:water" and lnode.name ~= "default:water_flowing" then
local newnode
repeat
- minetest.env:remove_node(lpos)
+ minetest.env:dig_node(lpos)
lpos.x=lpos.x+direction.x
lpos.y=lpos.y+direction.y
lpos.z=lpos.z+direction.z
newnode = {name=lnode.name}
lnode = minetest.env:get_node(lpos)
- minetest.env:add_node(lpos, newnode)
+ minetest.env:place_node(lpos, newnode)
nodeupdate(lpos)
until lnode.name == "ignore" or lnode.name == "air" or lnode.name == "default:water" or lnode.name == "default:water_flowing"
end
@@ -198,7 +198,7 @@ minetest.register_entity("mesecons_movestones:sticky_movestone_entity", {
local oldpos = {x=lpos2.x+direction.x, y=lpos2.y+direction.y, z=lpos2.z+direction.z}
repeat
- minetest.env:add_node(oldpos, {name=minetest.env:get_node(lpos2).name})
+ minetest.env:place_node(oldpos, {name=minetest.env:get_node(lpos2).name})
nodeupdate(oldpos)
oldpos = {x=lpos2.x, y=lpos2.y, z=lpos2.z}
lpos2.x = lpos2.x-direction.x
@@ -206,7 +206,7 @@ minetest.register_entity("mesecons_movestones:sticky_movestone_entity", {
lpos2.z = lpos2.z-direction.z
lnode = minetest.env:get_node(lpos2)
until lnode.name=="air" or lnode.name=="ignore" or lnode.name=="default:water" or lnode.name=="default:water_flowing"
- minetest.env:remove_node(oldpos)
+ minetest.env:dig_node(oldpos)
end
})
@@ -237,7 +237,7 @@ mesecon:register_on_signal_on(function (pos, node)
or checknode.name=="default:water"
or checknode.name=="default:water_flowing"
- minetest.env:remove_node(pos)
+ minetest.env:dig_node(pos)
nodeupdate(pos)
minetest.env:add_entity(pos, "mesecons_movestones:sticky_movestone_entity")
end