mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-30 17:27:28 +01:00
Fix whitespace, simplify node updating.
This commit is contained in:
parent
208e95c2ff
commit
cd8fd55fe3
@ -198,9 +198,6 @@ mesecon:register_on_signal_off(function(pos, node)
|
|||||||
|
|
||||||
--retract piston
|
--retract piston
|
||||||
minetest.env:remove_node(pos) --remove pusher
|
minetest.env:remove_node(pos) --remove pusher
|
||||||
if node.name ~= "mesecons_pistons:piston_down_sticky" then
|
|
||||||
nodeupdate(pos)
|
|
||||||
end
|
|
||||||
if node.name == "mesecons_pistons:piston_down_sticky" then --retract block
|
if node.name == "mesecons_pistons:piston_down_sticky" then --retract block
|
||||||
local checkpos = {x=pos.x + dir.x, y=pos.y + dir.y, z=pos.z + dir.z} --move to the node to be retracted
|
local checkpos = {x=pos.x + dir.x, y=pos.y + dir.y, z=pos.z + dir.z} --move to the node to be retracted
|
||||||
checknode = minetest.env:get_node(checkpos)
|
checknode = minetest.env:get_node(checkpos)
|
||||||
@ -209,12 +206,10 @@ mesecon:register_on_signal_off(function(pos, node)
|
|||||||
and minetest.registered_nodes[checknode.name].liquidtype == "none"
|
and minetest.registered_nodes[checknode.name].liquidtype == "none"
|
||||||
and not mesecon:is_mvps_stopper(checknode.name) then
|
and not mesecon:is_mvps_stopper(checknode.name) then
|
||||||
minetest.env:remove_node(checkpos)
|
minetest.env:remove_node(checkpos)
|
||||||
mesecon:updatenode(checkpos)
|
mesecon:updatenode(checkpos)
|
||||||
minetest.env:set_node(pos, checknode)
|
minetest.env:set_node(pos, checknode)
|
||||||
mesecon:updatenode(pos)
|
mesecon:updatenode(pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if node.name == "mesecons_pistons:piston_down_sticky" then
|
nodeupdate(pos)
|
||||||
nodeupdate(pos)
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
@ -186,9 +186,6 @@ mesecon:register_on_signal_off(function(pos, node)
|
|||||||
|
|
||||||
--retract piston
|
--retract piston
|
||||||
minetest.env:remove_node(pos) --remove pusher
|
minetest.env:remove_node(pos) --remove pusher
|
||||||
if node.name ~= "mesecons_pistons:piston_up_sticky" then
|
|
||||||
nodeupdate(pos)
|
|
||||||
end
|
|
||||||
if node.name == "mesecons_pistons:piston_up_sticky" then --retract block
|
if node.name == "mesecons_pistons:piston_up_sticky" then --retract block
|
||||||
local checkpos = {x=pos.x + dir.x, y=pos.y + dir.y, z=pos.z + dir.z} --move to the node to be retracted
|
local checkpos = {x=pos.x + dir.x, y=pos.y + dir.y, z=pos.z + dir.z} --move to the node to be retracted
|
||||||
checknode = minetest.env:get_node(checkpos)
|
checknode = minetest.env:get_node(checkpos)
|
||||||
@ -197,12 +194,10 @@ mesecon:register_on_signal_off(function(pos, node)
|
|||||||
and minetest.registered_nodes[checknode.name].liquidtype == "none"
|
and minetest.registered_nodes[checknode.name].liquidtype == "none"
|
||||||
and not mesecon:is_mvps_stopper(checknode.name) then
|
and not mesecon:is_mvps_stopper(checknode.name) then
|
||||||
minetest.env:remove_node(checkpos)
|
minetest.env:remove_node(checkpos)
|
||||||
mesecon:updatenode(checkpos)
|
mesecon:updatenode(checkpos)
|
||||||
minetest.env:set_node(pos, checknode)
|
minetest.env:set_node(pos, checknode)
|
||||||
mesecon:updatenode(pos)
|
mesecon:updatenode(pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if node.name == "mesecons_pistons:piston_up_sticky" then
|
nodeupdate(pos)
|
||||||
nodeupdate(pos)
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user