Change set_node to swap_node for update events

This commit is contained in:
Elias Åström 2024-11-04 19:33:43 +01:00 committed by cora
parent 82a37ee4f7
commit 53bb9bd51c
2 changed files with 4 additions and 2 deletions

View File

@ -117,7 +117,8 @@ local function handle_update_event(event)
if oldnode.name ~= event.oldnode.name or oldnode.param2 ~= event.oldnode.param2 then
return
end
minetest.set_node(event.pos, event.node)
minetest.swap_node(event.pos, event.node)
mcl_redstone._update_neighbours(event.pos, event.oldnode)
update_event_tab[h] = nil
end

View File

@ -225,8 +225,9 @@ function mcl_redstone._update_neighbours(pos, oldnode)
end
function mcl_redstone.swap_node(pos, node)
local oldnode = minetest.get_node(pos)
minetest.swap_node(pos, node)
mcl_redstone._update_neighbours(pos, node)
mcl_redstone._update_neighbours(pos, oldnode)
end
-- Update neighbouring wires and components at pos. Oldnode is the previous