diff options
author | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-10-01 17:36:03 +0100 |
---|---|---|
committer | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-10-01 17:36:03 +0100 |
commit | e6b55028fc9b6a50ecd6c28c2af1ee94e041edcd (patch) | |
tree | 03e2070637f9c96170c7463edd50fc2286e5492f | |
parent | caacc2a2613706c53b7ee27b04b5a4d7584a83f7 (diff) | |
download | pipeworks-e6b55028fc9b6a50ecd6c28c2af1ee94e041edcd.tar pipeworks-e6b55028fc9b6a50ecd6c28c2af1ee94e041edcd.tar.gz pipeworks-e6b55028fc9b6a50ecd6c28c2af1ee94e041edcd.tar.bz2 pipeworks-e6b55028fc9b6a50ecd6c28c2af1ee94e041edcd.tar.xz pipeworks-e6b55028fc9b6a50ecd6c28c2af1ee94e041edcd.zip |
move pump flow logic registration to devices.lua
-rw-r--r-- | devices.lua | 5 | ||||
-rw-r--r-- | new_flow_logic/register_local_pipes.lua | 6 | ||||
-rw-r--r-- | pipes.lua | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/devices.lua b/devices.lua index 26df862..670ed6c 100644 --- a/devices.lua +++ b/devices.lua @@ -1,3 +1,4 @@ +local new_flow_logic_register = pipeworks.flowables.register -- rotation handlers @@ -163,6 +164,10 @@ for s in ipairs(states) do -- FIXME - does this preserve metadata? need to look at this on_rotate = screwdriver.rotate_simple }) + new_flow_logic_register.simple(pumpname) + if states[s] ~= "off" then + new_flow_logic_register.intake_simple(pumpname, 2) + end local nodename_valve_empty = "pipeworks:valve_"..states[s].."_empty" minetest.register_node(nodename_valve_empty, { diff --git a/new_flow_logic/register_local_pipes.lua b/new_flow_logic/register_local_pipes.lua index 5128d47..005a812 100644 --- a/new_flow_logic/register_local_pipes.lua +++ b/new_flow_logic/register_local_pipes.lua @@ -40,12 +40,12 @@ if pipeworks.enable_pipes then ]] if pipeworks.enable_pipe_devices then - register.simple(pump_off) - register.simple(pump_on) + --register.simple(pump_off) + --register.simple(pump_on) register.simple(spigot_on) register.simple(spigot_off) - register.intake_simple(pump_on, thresholds.pump_pressure) + --register.intake_simple(pump_on, thresholds.pump_pressure) -- TODO: the code doesn't currently care if the spigot is the visually flowing node or not. -- So some mechanism to register on/off states would be nice register.output(spigot_off, thresholds.spigot_min, flowlogic.helpers.output_spigot) @@ -195,6 +195,7 @@ local valve_on = "pipeworks:valve_on_empty" local valve_off = "pipeworks:valve_off_empty" local entry_panel_empty = "pipeworks:entry_panel_empty" local flow_sensor_empty = "pipeworks:flow_sensor_empty" +-- XXX: why aren't these in devices.lua!? table.insert(pipes_empty_nodenames, valve_on) table.insert(pipes_empty_nodenames, valve_off) table.insert(pipes_empty_nodenames, entry_panel_empty) |