Only update nodes that has not changed

This commit is contained in:
Elias Åström 2024-09-23 20:47:31 +02:00 committed by cora
parent b1d19019a6
commit 6c92873314

View File

@ -208,10 +208,14 @@ local function schedule_update(pos, update)
local param2 = update.param2 or 0
mcl_redstone._schedule_event(delay, priority, pos, function()
-- Only update if node is not the same or has not changed.
local node = minetest.get_node(pos)
if update.name == node.name and param2 == node.param2 then
return
end
if node.name ~= oldnode.name or node.param2 ~= oldnode.param2 then
return
end
minetest.swap_node(pos, {
name = update.name,