forked from mtcontrib/pipeworks
new flow logic: flowable_node_registry_install.lua: add registration tracing
This commit is contained in:
parent
d9b616c5f0
commit
f3cd1b61d7
4
init.lua
4
init.lua
|
@ -94,6 +94,10 @@ function pipeworks.replace_name(tbl,tr,name)
|
||||||
return ntbl
|
return ntbl
|
||||||
end
|
end
|
||||||
|
|
||||||
|
pipeworks.logger = function(msg)
|
||||||
|
print("[pipeworks] "..msg)
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
-- Load the various other parts of the mod
|
-- Load the various other parts of the mod
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,12 @@ local insertbase = function(nodename)
|
||||||
-- table.insert(pipeworks.flowables.list.nodenames, nodename)
|
-- table.insert(pipeworks.flowables.list.nodenames, nodename)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local regwarning = function(kind, nodename)
|
||||||
|
local tail = ""
|
||||||
|
if pipeworks.enable_new_flow_logic then tail = " but new_flow_logic not enabled" end
|
||||||
|
pipeworks.logger("[pipeworks] "..kind.." flow logic registry requested for "..nodename..tail)
|
||||||
|
end
|
||||||
|
|
||||||
-- Register a node as a simple flowable.
|
-- Register a node as a simple flowable.
|
||||||
-- Simple flowable nodes have no considerations for direction of flow;
|
-- Simple flowable nodes have no considerations for direction of flow;
|
||||||
-- A cluster of adjacent simple flowables will happily average out in any direction.
|
-- A cluster of adjacent simple flowables will happily average out in any direction.
|
||||||
|
@ -32,6 +38,7 @@ register.simple = function(nodename)
|
||||||
if pipeworks.enable_new_flow_logic then
|
if pipeworks.enable_new_flow_logic then
|
||||||
abmregister.balance(nodename)
|
abmregister.balance(nodename)
|
||||||
end
|
end
|
||||||
|
regwarning("simple", nodename)
|
||||||
end
|
end
|
||||||
|
|
||||||
local checkbase = function(nodename)
|
local checkbase = function(nodename)
|
||||||
|
@ -50,6 +57,7 @@ register.intake_simple = function(nodename, maxpressure)
|
||||||
if pipeworks.enable_new_flow_logic then
|
if pipeworks.enable_new_flow_logic then
|
||||||
abmregister.input(nodename, maxpressure, pipeworks.flowlogic.check_for_liquids_v2)
|
abmregister.input(nodename, maxpressure, pipeworks.flowlogic.check_for_liquids_v2)
|
||||||
end
|
end
|
||||||
|
regwarning("simple intake", nodename)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Register a node as an output.
|
-- Register a node as an output.
|
||||||
|
@ -61,6 +69,7 @@ register.output = function(nodename, threshold, outputfn)
|
||||||
if pipeworks.enable_new_flow_logic then
|
if pipeworks.enable_new_flow_logic then
|
||||||
abmregister.output(nodename, threshold, outputfn)
|
abmregister.output(nodename, threshold, outputfn)
|
||||||
end
|
end
|
||||||
|
regwarning("output node", nodename)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODOs here:
|
-- TODOs here:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user