summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-17 05:26:10 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-17 10:07:34 -0400
commitbd4a27d1722a8e31a5f47a2405f1f9a3871e3341 (patch)
treeba8777bba31e1dc95cd5ebc3d6177db6aaf38e91
parent3d845a3f2869111ef0eff109ff210f1b03a532f3 (diff)
downloadpipeworks-bd4a27d1722a8e31a5f47a2405f1f9a3871e3341.tar
pipeworks-bd4a27d1722a8e31a5f47a2405f1f9a3871e3341.tar.gz
pipeworks-bd4a27d1722a8e31a5f47a2405f1f9a3871e3341.tar.bz2
pipeworks-bd4a27d1722a8e31a5f47a2405f1f9a3871e3341.tar.xz
pipeworks-bd4a27d1722a8e31a5f47a2405f1f9a3871e3341.zip
make valve and pump turn on/off via on_rightclick
(instead of on_punch)
-rw-r--r--devices.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/devices.lua b/devices.lua
index e4c5f43..a102a28 100644
--- a/devices.lua
+++ b/devices.lua
@@ -73,8 +73,8 @@ for s in ipairs(states) do
minetest.add_node(pos,{name="pipeworks:pump_off", param2 = node.param2})
end
}},
- on_punch = function(pos, node, puncher)
- local fdir = minetest.get_node(pos).param2
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
+ local fdir = node.param2
minetest.add_node(pos, { name = "pipeworks:pump_"..states[3-s], param2 = fdir })
end
})
@@ -104,7 +104,7 @@ for s in ipairs(states) do
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
- drop = "pipeworks:valve_off_empty",
+ drop = "pipeworks:valve_off_empty",
mesecons = {effector = {
action_on = function (pos, node)
minetest.add_node(pos,{name="pipeworks:valve_on_empty", param2 = node.param2})
@@ -113,8 +113,8 @@ for s in ipairs(states) do
minetest.add_node(pos,{name="pipeworks:valve_off_empty", param2 = node.param2})
end
}},
- on_punch = function(pos, node, puncher)
- local fdir = minetest.get_node(pos).param2
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
+ local fdir = node.param2
minetest.add_node(pos, { name = "pipeworks:valve_"..states[3-s].."_empty", param2 = fdir })
end
})
@@ -154,8 +154,8 @@ minetest.register_node("pipeworks:valve_on_loaded", {
minetest.add_node(pos,{name="pipeworks:valve_off_empty", param2 = node.param2})
end
}},
- on_punch = function(pos, node, puncher)
- local fdir = minetest.get_node(pos).param2
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
+ local fdir = node.param2
minetest.add_node(pos, { name = "pipeworks:valve_off_empty", param2 = fdir })
end
})