summaryrefslogtreecommitdiff
path: root/mesecons_lightstone
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2012-12-11 19:49:55 +0100
committerJeija <norrepli@gmail.com>2012-12-11 19:49:55 +0100
commitde46729b971b5e59394834b8a01d4a7005318114 (patch)
tree5a2cf1f18b485ddefa8e255ac6d6a600ef2e2e12 /mesecons_lightstone
parent31f3c99288355193dc68a6e83dfc63140fd02fa0 (diff)
parent5540fcbcb31eb32003fa0391113ed3b1dea25e47 (diff)
downloadmesecons-de46729b971b5e59394834b8a01d4a7005318114.tar
mesecons-de46729b971b5e59394834b8a01d4a7005318114.tar.gz
mesecons-de46729b971b5e59394834b8a01d4a7005318114.tar.bz2
mesecons-de46729b971b5e59394834b8a01d4a7005318114.tar.xz
mesecons-de46729b971b5e59394834b8a01d4a7005318114.zip
Merge branch 'mesecons_in_nodedef'
Conflicts: mesecons/internal.lua
Diffstat (limited to 'mesecons_lightstone')
-rw-r--r--mesecons_lightstone/init.lua47
1 files changed, 22 insertions, 25 deletions
diff --git a/mesecons_lightstone/init.lua b/mesecons_lightstone/init.lua
index fd8b5bf..aa0c9b3 100644
--- a/mesecons_lightstone/init.lua
+++ b/mesecons_lightstone/init.lua
@@ -1,30 +1,28 @@
function mesecon:lightstone_add(name, base_item, texture_off, texture_on)
- minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_off", {
- tiles = {texture_off},
- inventory_image = minetest.inventorycube(texture_off),
- groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2},
- description=name.." Lightstone",
+ minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_off", {
+ tiles = {texture_off},
+ inventory_image = minetest.inventorycube(texture_off),
+ groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2},
+ description=name.." Lightstone",
+ mesecons = {effector = {
+ action_on = function (pos, node)
+ mesecon:swap_node(pos, "mesecons_lightstone:lightstone_" .. name .. "_on")
+ end
+ }}
})
- minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_on", {
- tiles = {texture_on},
- inventory_image = minetest.inventorycube(texture_on),
- groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2},
- drop = "node mesecons_lightstone:lightstone_" .. name .. "_off 1",
- light_source = LIGHT_MAX-2,
- description=name.." Lightstone",
+ minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_on", {
+ tiles = {texture_on},
+ inventory_image = minetest.inventorycube(texture_on),
+ groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2},
+ drop = "node mesecons_lightstone:lightstone_" .. name .. "_off 1",
+ light_source = LIGHT_MAX-2,
+ mesecons = {effector = {
+ action_off = function (pos, node)
+ mesecon:swap_node(pos, "mesecons_lightstone:lightstone_" .. name .. "_off")
+ end
+ }}
})
- assert(loadstring('mesecon:register_on_signal_on(function(pos, node) \n \
- if node.name == "mesecons_lightstone:lightstone_' .. name .. '_off" then \n \
- minetest.env:add_node(pos, {name="mesecons_lightstone:lightstone_' .. name .. '_on"}) \n \
- nodeupdate(pos) \n \
- end \n \
- end)'))()
- assert(loadstring('mesecon:register_on_signal_off(function(pos, node) \n \
- if node.name == "mesecons_lightstone:lightstone_' .. name .. '_on" then \n \
- minetest.env:add_node(pos, {name="mesecons_lightstone:lightstone_' .. name .. '_off"}) \n \
- nodeupdate(pos) \n \
- end \n \
- end)'))()
+
minetest.register_craft({
output = "node mesecons_lightstone:lightstone_" .. name .. "_off 1",
recipe = {
@@ -33,7 +31,6 @@ function mesecon:lightstone_add(name, base_item, texture_off, texture_on)
{'','group:mesecon_conductor_craftable',''},
}
})
- mesecon:register_effector("mesecons_lightstone:lightstone_" .. name .. "_on", "mesecons_lightstone:lightstone_" .. name .. "_off")
end