2012-03-05 19:21:26 +01:00
|
|
|
-- MESELAMPS
|
2012-12-09 00:42:30 +01:00
|
|
|
-- A lamp is "is an electrical device used to create artificial light" (wikipedia)
|
|
|
|
-- guess what?
|
|
|
|
|
2017-01-15 11:53:49 +01:00
|
|
|
local mesecon_lamp_box = {
|
2012-12-26 22:54:28 +01: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
|
|
|
minetest.register_node("mesecons_lamp:lamp_on", {
|
2012-08-01 19:28:02 +02:00
|
|
|
drawtype = "nodebox",
|
2012-08-20 10:12:10 +02:00
|
|
|
tiles = {"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,
|
2015-05-11 06:28:56 +02:00
|
|
|
light_source = default.LIGHT_MAX,
|
2012-12-26 22:54:28 +01:00
|
|
|
node_box = mesecon_lamp_box,
|
|
|
|
selection_box = mesecon_lamp_box,
|
2012-12-09 00:42:30 +01:00
|
|
|
groups = {dig_immediate=3,not_in_creative_inventory=1, mesecon_effector_on = 1},
|
2013-04-28 12:40:08 +02:00
|
|
|
drop="mesecons_lamp:lamp_off 1",
|
2013-03-07 02:51:57 +01:00
|
|
|
sounds = default.node_sound_glass_defaults(),
|
2012-12-09 00:42:30 +01:00
|
|
|
mesecons = {effector = {
|
|
|
|
action_off = function (pos, node)
|
2013-12-01 02:20:01 +01:00
|
|
|
minetest.swap_node(pos, {name = "mesecons_lamp:lamp_off", param2 = node.param2})
|
2012-12-09 00:42:30 +01:00
|
|
|
end
|
|
|
|
}}
|
2012-03-05 19:21:26 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("mesecons_lamp:lamp_off", {
|
2012-08-01 19:28:02 +02:00
|
|
|
drawtype = "nodebox",
|
2012-08-20 10:12:10 +02:00
|
|
|
tiles = {"jeija_meselamp_off.png"},
|
2012-08-01 19:28:02 +02:00
|
|
|
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-12-26 22:54:28 +01:00
|
|
|
node_box = mesecon_lamp_box,
|
|
|
|
selection_box = mesecon_lamp_box,
|
2012-12-09 00:42:30 +01:00
|
|
|
groups = {dig_immediate=3, mesecon_receptor_off = 1, mesecon_effector_off = 1},
|
2012-03-05 19:21:26 +01:00
|
|
|
description="Meselamp",
|
2013-03-07 02:51:57 +01:00
|
|
|
sounds = default.node_sound_glass_defaults(),
|
2012-12-09 00:42:30 +01:00
|
|
|
mesecons = {effector = {
|
|
|
|
action_on = function (pos, node)
|
2013-12-01 02:20:01 +01:00
|
|
|
minetest.swap_node(pos, {name = "mesecons_lamp:lamp_on", param2 = node.param2})
|
2012-12-09 00:42:30 +01:00
|
|
|
end
|
|
|
|
}}
|
2012-03-05 19:21:26 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2013-04-28 12:40:08 +02:00
|
|
|
output = "mesecons_lamp:lamp_off 1",
|
2012-03-05 19:21:26 +01:00
|
|
|
recipe = {
|
2013-04-28 12:40:08 +02:00
|
|
|
{"", "default:glass", ""},
|
|
|
|
{"group:mesecon_conductor_craftable", "default:steel_ingot", "group:mesecon_conductor_craftable"},
|
|
|
|
{"", "default:glass", ""},
|
2012-03-05 19:21:26 +01:00
|
|
|
}
|
|
|
|
})
|