summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-05-10 17:44:26 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-05-10 17:44:26 -0400
commit509fac3845cc06b5b1673d9516fd998265058298 (patch)
treeab61f2ef1c0d615cdafb1a90f37d802a2c32a24a
parent9231f9fa016cf2d2ad354e5e1a87acbf39873303 (diff)
downloadpipeworks-509fac3845cc06b5b1673d9516fd998265058298.tar
pipeworks-509fac3845cc06b5b1673d9516fd998265058298.tar.gz
pipeworks-509fac3845cc06b5b1673d9516fd998265058298.tar.bz2
pipeworks-509fac3845cc06b5b1673d9516fd998265058298.tar.xz
pipeworks-509fac3845cc06b5b1673d9516fd998265058298.zip
Make pumps and valves respond to mesecons signals
-rw-r--r--devices.lua29
1 files changed, 27 insertions, 2 deletions
diff --git a/devices.lua b/devices.lua
index 41bd414..dcd5967 100644
--- a/devices.lua
+++ b/devices.lua
@@ -109,7 +109,15 @@ for s in ipairs(states) do
after_dig_node = function(pos)
pipe_scanforobjects(pos)
end,
- drop = "pipeworks:pump_off"
+ drop = "pipeworks:pump_off",
+ mesecons = {effector = {
+ action_on = function (pos, node)
+ minetest.env:add_node(pos,{name="pipeworks:pump_on", param2 = node.param2})
+ end,
+ action_off = function (pos, node)
+ minetest.env:add_node(pos,{name="pipeworks:pump_off", param2 = node.param2})
+ end
+ }}
})
local valveboxes = {}
@@ -161,6 +169,14 @@ for s in ipairs(states) do
end,
drop = "pipeworks:valve_off",
pipelike=1,
+ mesecons = {effector = {
+ action_on = function (pos, node)
+ minetest.env:add_node(pos,{name="pipeworks:valve_on_empty", param2 = node.param2})
+ end,
+ action_off = function (pos, node)
+ minetest.env:add_node(pos,{name="pipeworks:valve_off_empty", param2 = node.param2})
+ end
+ }}
})
end
@@ -207,6 +223,14 @@ minetest.register_node("pipeworks:valve_on_loaded", {
end,
drop = "pipeworks:valve_off_empty",
pipelike=1,
+ mesecons = {effector = {
+ action_on = function (pos, node)
+ minetest.env:add_node(pos,{name="pipeworks:valve_on_empty", param2 = node.param2})
+ end,
+ action_off = function (pos, node)
+ minetest.env:add_node(pos,{name="pipeworks:valve_off_empty", param2 = node.param2})
+ end
+ }}
})
-- grating
@@ -411,7 +435,8 @@ minetest.register_node("pipeworks:entry_panel_loaded", {
{ -2/16, -2/16, -8/16, 2/16, 2/16, 8/16 },
{ -8/16, -8/16, -1/16, 8/16, 8/16, 1/16 }
}
- }
+ },
+ drop = "pipeworks:entry_panel_empty"
})
-- tanks