summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2012-08-08 12:40:18 +0200
committersfan5 <sfan5@live.de>2012-08-08 12:40:18 +0200
commit10fe94dea7829b1b7083d42e2827643f6cabf188 (patch)
tree209dfbd82a67969f7cb900875f77418667d814e1
parent13538d56d9a822e0a9de6583f59e2258729f6e14 (diff)
downloadmesecons-10fe94dea7829b1b7083d42e2827643f6cabf188.tar
mesecons-10fe94dea7829b1b7083d42e2827643f6cabf188.tar.gz
mesecons-10fe94dea7829b1b7083d42e2827643f6cabf188.tar.bz2
mesecons-10fe94dea7829b1b7083d42e2827643f6cabf188.tar.xz
mesecons-10fe94dea7829b1b7083d42e2827643f6cabf188.zip
Make Pistons use set_node not dig_node (Speed Improvement)
-rw-r--r--mesecons_pistons/init.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua
index 73cb119..742395a 100644
--- a/mesecons_pistons/init.lua
+++ b/mesecons_pistons/init.lua
@@ -150,7 +150,8 @@ mesecon:register_on_signal_on(function(pos, node)
end
local checknode = minetest.env:get_node(pos)
- minetest.env:dig_node(pos) --remove the first node
+ minetest.env:remove_node(pos) --remove the first node
+ mesecon:updatenode(pos)
--add pusher
if node.name == "mesecons_pistons:piston_normal" then
@@ -165,8 +166,9 @@ mesecon:register_on_signal_on(function(pos, node)
--move the node forward
local nextnode = minetest.env:get_node(pos)
- minetest.env:dig_node(pos)
- minetest.env:place_node(pos, checknode)
+ --minetest.env:dig_node(pos)
+ minetest.env:set_node(pos, checknode)
+ mesecon:updatenode(pos)
checknode = nextnode
end
end)
@@ -204,8 +206,9 @@ mesecon:register_on_signal_off(function(pos, node)
and checknode.name ~= "default:lava_source"
and checknode.name ~= "default:lava_flowing"
and not mesecon:is_mvps_stopper(checknode.name) then
- minetest.env:place_node(pos, checknode)
- minetest.env:dig_node(checkpos)
+ minetest.env:set_node(pos, checknode)
+ mesecon:updatenode(pos)
+ --minetest.env:dig_node(pos)
end
end
if node.name == "mesecons_pistons:piston_sticky" then