mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-09-12 07:58:32 +02:00
Make Pistons use set_node not dig_node (Speed Improvement)
This commit is contained in:
parent
13538d56d9
commit
10fe94dea7
@ -150,7 +150,8 @@ mesecon:register_on_signal_on(function(pos, node)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local checknode = minetest.env:get_node(pos)
|
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
|
--add pusher
|
||||||
if node.name == "mesecons_pistons:piston_normal" then
|
if node.name == "mesecons_pistons:piston_normal" then
|
||||||
@ -165,8 +166,9 @@ mesecon:register_on_signal_on(function(pos, node)
|
|||||||
|
|
||||||
--move the node forward
|
--move the node forward
|
||||||
local nextnode = minetest.env:get_node(pos)
|
local nextnode = minetest.env:get_node(pos)
|
||||||
minetest.env:dig_node(pos)
|
--minetest.env:dig_node(pos)
|
||||||
minetest.env:place_node(pos, checknode)
|
minetest.env:set_node(pos, checknode)
|
||||||
|
mesecon:updatenode(pos)
|
||||||
checknode = nextnode
|
checknode = nextnode
|
||||||
end
|
end
|
||||||
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_source"
|
||||||
and checknode.name ~= "default:lava_flowing"
|
and checknode.name ~= "default:lava_flowing"
|
||||||
and not mesecon:is_mvps_stopper(checknode.name) then
|
and not mesecon:is_mvps_stopper(checknode.name) then
|
||||||
minetest.env:place_node(pos, checknode)
|
minetest.env:set_node(pos, checknode)
|
||||||
minetest.env:dig_node(checkpos)
|
mesecon:updatenode(pos)
|
||||||
|
--minetest.env:dig_node(pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if node.name == "mesecons_pistons:piston_sticky" then
|
if node.name == "mesecons_pistons:piston_sticky" then
|
||||||
|
Loading…
Reference in New Issue
Block a user