summaryrefslogtreecommitdiff
path: root/new_flow_logic/flowable_node_registry.lua
blob: b0634d04ac9aec31aa4f7cc16aa5a89bff3ec424 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
-- registry of flowable node behaviours in new flow logic
-- written 2017 by thetaepsilon

-- the actual registration functions which edit these tables can be found in flowable_node_registry_install.lua
-- this is because the ABM code needs to inspect these tables,
-- but the registration code needs to reference said ABM code.
-- so those functions were split out to resolve a circular dependency.



pipeworks.flowables = {}
pipeworks.flowables.list = {}
pipeworks.flowables.list.all = {}
-- pipeworks.flowables.list.nodenames = {}

-- simple flowables - balance pressure in any direction
pipeworks.flowables.list.simple = {}
pipeworks.flowables.list.simple_nodenames = {}

-- simple intakes - try to absorb any adjacent water nodes
pipeworks.flowables.inputs = {}
pipeworks.flowables.inputs.list = {}
pipeworks.flowables.inputs.nodenames = {}

-- outputs - takes pressure from pipes and update world to do something with it
pipeworks.flowables.outputs = {}
pipeworks.flowables.outputs.list = {}
-- not currently any nodenames arraylist for this one as it's not currently needed.



-- checks if a given node can flow in a given direction.
-- used to implement directional devices such as pumps,
-- which only visually connect in a certain direction.
-- node is the usual name + param structure.
-- direction is an x/y/z vector of the flow direction;
-- this function answers the question "can this node flow in this direction?"
pipeworks.flowables.flow_check = function(node, direction)
	minetest.log("warning", "pipeworks.flowables.flow_check() stub!")
	return true
end