Remove unnecessary branch

This commit is contained in:
snoutie 2025-01-06 11:07:19 +01:00
parent a8dfbc003e
commit f0f9c5f2d4

View File

@ -267,12 +267,7 @@ core.register_on_mapblocks_changed(function(modified_blocks, modified_blocks_cou
--Update only changed nodes from buffer
for _, lpn in pairs(b) do
if lpn.init_liquid_level ~= lpn.liquid_level then
--TODO: Find out whether set_node or set_node_level is faster
if lpn.liquid_level >= 0 or lpn.liquid_level >= 8 then
core.set_node(lpn.pos, { name = liquid_physics.get_liquid_node_name(lpn.liquid_id, lpn.liquid_level) })
elseif lpn.liquid_level < 8 then
core.set_node_level(lpn.pos, lpn.liquid_level)
end
core.set_node(lpn.pos, { name = liquid_physics.get_liquid_node_name(lpn.liquid_id, lpn.liquid_level) })
end
end
end)