2012-03-05 19:21:26 +01:00
|
|
|
-- MESELAMPS
|
|
|
|
minetest.register_node("mesecons_lamp:lamp_on", {
|
2012-08-01 19:28:02 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tile_images = {"jeija_meselamp_on.png"},
|
2012-03-05 19:21:26 +01:00
|
|
|
paramtype = "light",
|
2012-08-01 19:28:02 +02:00
|
|
|
paramtype2 = "wallmounted",
|
|
|
|
legacy_wallmounted = true,
|
2012-03-05 19:21:26 +01:00
|
|
|
sunlight_propagates = true,
|
2012-08-05 13:37:20 +02:00
|
|
|
walkable = true,
|
2012-03-05 19:21:26 +01:00
|
|
|
light_source = LIGHT_MAX,
|
2012-08-01 19:28:02 +02:00
|
|
|
node_box = {
|
|
|
|
type = "wallmounted",
|
|
|
|
wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125},
|
|
|
|
wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125},
|
|
|
|
wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125},
|
|
|
|
},
|
2012-03-05 19:21:26 +01:00
|
|
|
selection_box = {
|
2012-08-01 19:28:02 +02:00
|
|
|
type = "wallmounted",
|
|
|
|
wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125},
|
|
|
|
wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125},
|
|
|
|
wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125},
|
2012-03-05 19:21:26 +01:00
|
|
|
},
|
2012-08-11 23:39:28 +02:00
|
|
|
groups = {dig_immediate=3,not_in_creative_inventory=1, mesecon = 2},
|
2012-03-05 19:21:26 +01:00
|
|
|
drop='"mesecons_lamp:lamp_off" 1',
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("mesecons_lamp:lamp_off", {
|
2012-08-01 19:28:02 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tile_images = {"jeija_meselamp_off.png"},
|
|
|
|
inventory_image = "jeija_meselamp.png",
|
|
|
|
wield_image = "jeija_meselamp.png",
|
2012-03-05 19:21:26 +01:00
|
|
|
paramtype = "light",
|
2012-08-01 19:28:02 +02:00
|
|
|
paramtype2 = "wallmounted",
|
2012-03-05 19:21:26 +01:00
|
|
|
sunlight_propagates = true,
|
2012-08-05 13:37:20 +02:00
|
|
|
walkable = true,
|
2012-08-01 19:28:02 +02:00
|
|
|
node_box = {
|
|
|
|
type = "wallmounted",
|
|
|
|
wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125},
|
|
|
|
wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125},
|
|
|
|
wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125},
|
|
|
|
},
|
2012-03-05 19:21:26 +01:00
|
|
|
selection_box = {
|
2012-08-01 19:28:02 +02:00
|
|
|
type = "wallmounted",
|
|
|
|
wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125},
|
|
|
|
wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125},
|
|
|
|
wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125},
|
2012-03-05 19:21:26 +01:00
|
|
|
},
|
2012-08-11 23:39:28 +02:00
|
|
|
groups = {dig_immediate=3, mesecon = 2},
|
2012-03-05 19:21:26 +01:00
|
|
|
description="Meselamp",
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = '"mesecons_lamp:lamp_off" 1',
|
|
|
|
recipe = {
|
|
|
|
{'', '"default:glass"', ''},
|
|
|
|
{'"mesecons:mesecon_off"', '"default:steel_ingot"', '"mesecons:mesecon_off"'},
|
|
|
|
{'', '"default:glass"', ''},
|
|
|
|
}
|
|
|
|
})
|
2012-03-18 18:46:30 +01:00
|
|
|
|
|
|
|
mesecon:register_on_signal_on(function(pos, node)
|
|
|
|
if node.name == "mesecons_lamp:lamp_off" then
|
2012-08-01 19:28:02 +02:00
|
|
|
minetest.env:add_node(pos, {name="mesecons_lamp:lamp_on", param2 = node.param2})
|
2012-03-18 18:46:30 +01:00
|
|
|
nodeupdate(pos)
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
|
|
|
|
mesecon:register_on_signal_off(function(pos, node)
|
|
|
|
if node.name == "mesecons_lamp:lamp_on" then
|
2012-08-01 19:28:02 +02:00
|
|
|
minetest.env:add_node(pos, {name="mesecons_lamp:lamp_off", param2 = node.param2})
|
2012-03-18 18:46:30 +01:00
|
|
|
nodeupdate(pos)
|
|
|
|
end
|
2012-08-05 13:37:20 +02:00
|
|
|
end)
|