summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Zhang <azhang9@gmail.com>2012-03-18 13:46:30 -0400
committerAnthony Zhang <azhang9@gmail.com>2012-03-18 13:46:30 -0400
commit6bf1d17bbd86a5cd13cee0bd17d8d4a65a9848e7 (patch)
treed9a52bbf67a32b54da041334a3f7c4449dc53659
parentff75bcdcab2aab445ca6339b3b76686ef294de86 (diff)
downloadmesecons-6bf1d17bbd86a5cd13cee0bd17d8d4a65a9848e7.tar
mesecons-6bf1d17bbd86a5cd13cee0bd17d8d4a65a9848e7.tar.gz
mesecons-6bf1d17bbd86a5cd13cee0bd17d8d4a65a9848e7.tar.bz2
mesecons-6bf1d17bbd86a5cd13cee0bd17d8d4a65a9848e7.tar.xz
mesecons-6bf1d17bbd86a5cd13cee0bd17d8d4a65a9848e7.zip
For some reason Meselamps' functionality was not actually implemented.
-rw-r--r--mesecons_lamp/init.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/mesecons_lamp/init.lua b/mesecons_lamp/init.lua
index 1ff51bf..16be723 100644
--- a/mesecons_lamp/init.lua
+++ b/mesecons_lamp/init.lua
@@ -16,7 +16,6 @@ minetest.register_node("mesecons_lamp:lamp_on", {
},
material = minetest.digprop_constanttime(0.1),
drop='"mesecons_lamp:lamp_off" 1',
- description="Meselamp",
})
minetest.register_node("mesecons_lamp:lamp_off", {
@@ -44,3 +43,17 @@ minetest.register_craft({
{'', '"default:glass"', ''},
}
})
+
+mesecon:register_on_signal_on(function(pos, node)
+ if node.name == "mesecons_lamp:lamp_off" then
+ minetest.env:add_node(pos, {name="mesecons_lamp:lamp_on"})
+ nodeupdate(pos)
+ end
+end)
+
+mesecon:register_on_signal_off(function(pos, node)
+ if node.name == "mesecons_lamp:lamp_on" then
+ minetest.env:add_node(pos, {name="mesecons_lamp:lamp_off"})
+ nodeupdate(pos)
+ end
+end) \ No newline at end of file