mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-11-09 00:43:51 +01:00
Trigger Block Update when retracting Piston
This commit is contained in:
parent
98fc808c68
commit
55e74c04ed
@ -171,7 +171,7 @@ mesecon:register_on_signal_on(function(pos, node)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--Pull action (sticky only)
|
--Pull action
|
||||||
mesecon:register_on_signal_off(function(pos, node)
|
mesecon:register_on_signal_off(function(pos, node)
|
||||||
if node.name ~= "mesecons_pistons:piston_normal" and node.name ~= "mesecons_pistons:piston_sticky" then
|
if node.name ~= "mesecons_pistons:piston_normal" and node.name ~= "mesecons_pistons:piston_sticky" then
|
||||||
return
|
return
|
||||||
@ -191,6 +191,9 @@ 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_sticky" then
|
||||||
|
nodeupdate(pos)
|
||||||
|
end
|
||||||
if node.name == "mesecons_pistons:piston_sticky" then --retract block
|
if node.name == "mesecons_pistons:piston_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)
|
||||||
@ -205,6 +208,9 @@ mesecon:register_on_signal_off(function(pos, node)
|
|||||||
minetest.env:dig_node(checkpos)
|
minetest.env:dig_node(checkpos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if node.name == "mesecons_pistons:piston_sticky" then
|
||||||
|
nodeupdate(pos)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- get push direction
|
-- get push direction
|
||||||
|
Loading…
Reference in New Issue
Block a user