summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-10-01 18:18:47 +0100
committerthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-10-01 18:18:47 +0100
commit13383770ef61d93899ad272586daeb0d8d3b4072 (patch)
treebbd8a90bd0490d41a079257093ae4d59d700ec07
parenta1fc493de18bebd41e8d285ef610c0f8209fb609 (diff)
downloadpipeworks-13383770ef61d93899ad272586daeb0d8d3b4072.tar
pipeworks-13383770ef61d93899ad272586daeb0d8d3b4072.tar.gz
pipeworks-13383770ef61d93899ad272586daeb0d8d3b4072.tar.bz2
pipeworks-13383770ef61d93899ad272586daeb0d8d3b4072.tar.xz
pipeworks-13383770ef61d93899ad272586daeb0d8d3b4072.zip
move spigot behaviour registration to devices.lua
-rw-r--r--devices.lua9
-rw-r--r--new_flow_logic/register_local_pipes.lua8
2 files changed, 13 insertions, 4 deletions
diff --git a/devices.lua b/devices.lua
index 8b1725b..fd48033 100644
--- a/devices.lua
+++ b/devices.lua
@@ -372,6 +372,15 @@ minetest.register_node(nodename_spigot_loaded, {
drop = "pipeworks:spigot",
on_rotate = pipeworks.fix_after_rotation
})
+-- new flow logic does not currently distinguish between these two visual states.
+-- register both so existing flowing spigots continue to work (even if the visual doesn't match the spigot's behaviour).
+new_flow_logic_register.simple(nodename_spigot_empty)
+new_flow_logic_register.simple(nodename_spigot_loaded)
+local spigot_min = 1
+new_flow_logic_register.output(nodename_spigot_empty, spigot_min, pipeworks.flowlogic.helpers.output_spigot)
+new_flow_logic_register.output(nodename_spigot_loaded, spigot_min, pipeworks.flowlogic.helpers.output_spigot)
+
+
-- sealed pipe entry/exit (horizontal pipe passing through a metal
-- wall, for use in places where walls should look like they're airtight)
diff --git a/new_flow_logic/register_local_pipes.lua b/new_flow_logic/register_local_pipes.lua
index 005a812..0de0056 100644
--- a/new_flow_logic/register_local_pipes.lua
+++ b/new_flow_logic/register_local_pipes.lua
@@ -42,13 +42,13 @@ if pipeworks.enable_pipes then
if pipeworks.enable_pipe_devices then
--register.simple(pump_off)
--register.simple(pump_on)
- register.simple(spigot_on)
- register.simple(spigot_off)
+ --register.simple(spigot_on)
+ --register.simple(spigot_off)
--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)
- register.output(spigot_on, thresholds.spigot_min, flowlogic.helpers.output_spigot)
+ --register.output(spigot_off, thresholds.spigot_min, flowlogic.helpers.output_spigot)
+ --register.output(spigot_on, thresholds.spigot_min, flowlogic.helpers.output_spigot)
end
end