mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-11-10 01:13:57 +01:00
register_flow_logic.lua: begin refactoring abm registration to allow use by other mods
This commit is contained in:
parent
0251baf692
commit
8dfbcad949
@ -17,15 +17,20 @@ if pipeworks.enable_pipes then
|
||||
})
|
||||
end
|
||||
]]
|
||||
-- flowables.register.simple takes care of creating an array-like table of node names
|
||||
|
||||
local register_abm_balance = function(nodename)
|
||||
minetest.register_abm({
|
||||
nodenames = pipeworks.flowables.list.simple_nodenames,
|
||||
nodenames = { nodename },
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
pipeworks.flowlogic.balance_pressure(pos, node)
|
||||
end
|
||||
})
|
||||
end
|
||||
for nodename, _ in pairs(pipeworks.flowables.list.simple) do
|
||||
register_abm_balance(nodename)
|
||||
end
|
||||
|
||||
if pipeworks.enable_pipe_devices then
|
||||
-- absorb water into pumps if it'll fit
|
||||
|
Loading…
Reference in New Issue
Block a user