mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-11-18 16:20:42 +01:00
new flow logic: start adding replacement ABM logic
This commit is contained in:
parent
1669cfd451
commit
34cfee8a2f
@ -12,6 +12,25 @@ local flowlogic = pipeworks.flowlogic
|
||||
-- DISCUSS: should it be possible later on to raise the the rate of ABMs, or lower the chance?
|
||||
-- Currently all the intervals and chances are hardcoded below.
|
||||
|
||||
|
||||
|
||||
-- register node list for the main logic function.
|
||||
-- see flowlogic.run() in abms.lua.
|
||||
--[[
|
||||
local register_flowlogic_abm = function(nodename)
|
||||
minetest.register_abm({
|
||||
nodenames = { nodename },
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
flowlogic.run(pos, node)
|
||||
end
|
||||
})
|
||||
end
|
||||
]]
|
||||
|
||||
|
||||
|
||||
-- register a node name for the pressure balancing ABM.
|
||||
-- currently this only exists as a per-node function to allow nodes to be registered outside pipeworks.
|
||||
local register_abm_balance = function(nodename)
|
||||
|
@ -79,6 +79,10 @@ register.output = function(nodename, upper, lower, outputfn)
|
||||
if pipeworks.toggles.pressure_logic then
|
||||
abmregister.output(nodename, lower, outputfn)
|
||||
end
|
||||
-- output ABM now part of main flow logic ABM to preserve ordering.
|
||||
-- note that because outputs have to be a flowable first
|
||||
-- (and the installation of the flow logic ABM is conditional),
|
||||
-- registered output nodes for new_flow_logic is also still conditional on the enable flag.
|
||||
regwarning("output node", nodename)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user