summaryrefslogtreecommitdiff
path: root/devices.lua
diff options
context:
space:
mode:
Diffstat (limited to 'devices.lua')
-rw-r--r--devices.lua27
1 files changed, 13 insertions, 14 deletions
diff --git a/devices.lua b/devices.lua
index 5203bf3..093137e 100644
--- a/devices.lua
+++ b/devices.lua
@@ -161,16 +161,18 @@ for s in ipairs(states) do
local fdir = node.param2
minetest.swap_node(pos, { name = "pipeworks:pump_"..states[3-s], param2 = fdir })
end,
- -- FIXME - does this preserve metadata? need to look at this
on_rotate = screwdriver.rotate_simple
})
- -- FIXME: currently a simple flow device, but needs directionality checking
- new_flow_logic_register.simple(pumpname)
+
+ -- FIXME: this currently assumes that pumps can only rotate around the fixed axis pointing Y+.
+ new_flow_logic_register.directional_vertical_fixed(pumpname, true)
local pump_drive = 4
if states[s] ~= "off" then
new_flow_logic_register.intake_simple(pumpname, pump_drive)
end
+
+
local nodename_valve_empty = "pipeworks:valve_"..states[s].."_empty"
minetest.register_node(nodename_valve_empty, {
description = "Valve",
@@ -213,8 +215,7 @@ for s in ipairs(states) do
-- only register flow logic for the "on" ABM.
-- this means that the off state automatically blocks flow by not participating in the balancing operation.
if states[s] ~= "off" then
- -- FIXME: this still a simple device, directionality not honoured
- new_flow_logic_register.simple(nodename_valve_empty)
+ new_flow_logic_register.directional_horizonal_rotate(nodename_valve_empty)
end
end
@@ -262,7 +263,7 @@ minetest.register_node(nodename_valve_loaded, {
-- right-clicking a "loaded" valve (becoming an off valve) then turning it on again will yield a on-but-empty valve,
-- but the flow logic will still function.
-- thus under new_flow_logic this serves as a kind of migration.
-new_flow_logic_register.simple(nodename_valve_loaded)
+new_flow_logic_register.directional_horizonal_rotate(nodename_valve_loaded)
-- grating
@@ -436,10 +437,9 @@ minetest.register_node(nodename_panel_loaded, {
drop = "pipeworks:entry_panel_empty",
on_rotate = pipeworks.fix_after_rotation
})
--- FIXME requires-directionality
-- TODO: AFAIK the two panels have no visual difference, so are redundant under new flow logic - alias?
-new_flow_logic_register.simple(nodename_panel_empty)
-new_flow_logic_register.simple(nodename_panel_loaded)
+new_flow_logic_register.directional_horizonal_rotate(nodename_panel_empty)
+new_flow_logic_register.directional_horizonal_rotate(nodename_panel_loaded)
@@ -521,9 +521,8 @@ minetest.register_node(nodename_sensor_loaded, {
mesecons = pipereceptor_on,
on_rotate = pipeworks.fix_after_rotation
})
--- FIXME requires-directionality
-new_flow_logic_register.simple(nodename_sensor_empty)
-new_flow_logic_register.simple(nodename_sensor_loaded)
+new_flow_logic_register.directional_horizonal_rotate(nodename_sensor_empty)
+new_flow_logic_register.directional_horizonal_rotate(nodename_sensor_loaded)
-- activate flow sensor at roughly half the pressure pumps drive pipes
local sensor_pressure_set = { { nodename_sensor_empty, 0.0 }, { nodename_sensor_loaded, 1.0 } }
new_flow_logic_register.transition_simple_set(sensor_pressure_set, { mesecons=pipeworks.mesecons_rules })
@@ -672,8 +671,8 @@ minetest.register_node(nodename_fountain_loaded, {
drop = "pipeworks:fountainhead",
on_rotate = false
})
-new_flow_logic_register.simple(nodename_fountain_empty)
-new_flow_logic_register.simple(nodename_fountain_loaded)
+new_flow_logic_register.directional_vertical_fixed(nodename_fountain_empty, false)
+new_flow_logic_register.directional_vertical_fixed(nodename_fountain_loaded, false)
local fountain_upper = 1.0
local fountain_lower = 1.0
local fountain_neighbours={{x=0, y=1, z=0}}