2012-04-02 08:08:26 +02:00
|
|
|
-- WALL LEVER
|
2012-12-09 13:28:32 +01:00
|
|
|
-- Basically a switch that can be attached to a wall
|
|
|
|
-- Powers the block 2 nodes behind (using a receiver)
|
2014-11-22 20:49:54 +01:00
|
|
|
mesecon.register_node("mesecons_walllever:wall_lever", {
|
|
|
|
description="Lever",
|
2014-11-24 00:05:01 +01:00
|
|
|
drawtype = "mesh",
|
|
|
|
inventory_image = "jeija_wall_lever_inv.png",
|
|
|
|
wield_image = "jeija_wall_lever_inv.png",
|
2012-06-05 04:20:04 +02:00
|
|
|
paramtype = "light",
|
2012-08-10 02:00:36 +02:00
|
|
|
paramtype2 = "facedir",
|
2012-09-07 15:59:49 +02:00
|
|
|
sunlight_propagates = true,
|
2012-06-05 04:20:04 +02:00
|
|
|
walkable = false,
|
|
|
|
selection_box = {
|
2012-08-10 02:00:36 +02:00
|
|
|
type = "fixed",
|
|
|
|
fixed = { -8/16, -8/16, 3/16, 8/16, 8/16, 8/16 },
|
|
|
|
},
|
2014-11-22 20:49:54 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2015-10-01 19:13:12 +02:00
|
|
|
on_rightclick = function (pos, node)
|
2014-11-22 20:49:54 +01:00
|
|
|
if(mesecon.flipstate(pos, node) == "on") then
|
|
|
|
mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node))
|
|
|
|
else
|
|
|
|
mesecon.receptor_off(pos, mesecon.rules.buttonlike_get(node))
|
|
|
|
end
|
|
|
|
minetest.sound_play("mesecons_lever", {pos=pos})
|
|
|
|
end
|
|
|
|
},{
|
2015-05-20 09:00:06 +02:00
|
|
|
tiles = {
|
|
|
|
"jeija_wall_lever_lever_light_off.png",
|
|
|
|
"jeija_wall_lever_front.png",
|
|
|
|
"jeija_wall_lever_front_bump.png",
|
|
|
|
"jeija_wall_lever_back_edges.png"
|
|
|
|
},
|
2014-11-24 00:05:01 +01:00
|
|
|
mesh="jeija_wall_lever_off.obj",
|
2012-12-09 13:28:32 +01:00
|
|
|
mesecons = {receptor = {
|
|
|
|
rules = mesecon.rules.buttonlike_get,
|
2012-12-09 00:42:30 +01:00
|
|
|
state = mesecon.state.off
|
2014-11-22 20:49:54 +01:00
|
|
|
}},
|
|
|
|
groups = {dig_immediate = 2, mesecon_needs_receiver = 1}
|
|
|
|
},{
|
2015-05-20 09:00:06 +02:00
|
|
|
tiles = {
|
|
|
|
"jeija_wall_lever_lever_light_on.png",
|
|
|
|
"jeija_wall_lever_front.png",
|
|
|
|
"jeija_wall_lever_front_bump.png",
|
|
|
|
"jeija_wall_lever_back_edges.png"
|
|
|
|
},
|
2014-11-24 00:05:01 +01:00
|
|
|
mesh="jeija_wall_lever_on.obj",
|
2012-12-09 13:28:32 +01:00
|
|
|
mesecons = {receptor = {
|
|
|
|
rules = mesecon.rules.buttonlike_get,
|
2012-12-09 00:42:30 +01:00
|
|
|
state = mesecon.state.on
|
2014-11-22 20:49:54 +01:00
|
|
|
}},
|
|
|
|
groups = {dig_immediate = 2, mesecon_needs_receiver = 1, not_in_creative_inventory = 1}
|
2012-04-02 08:08:26 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2013-04-28 12:40:08 +02:00
|
|
|
output = "mesecons_walllever:wall_lever_off 2",
|
2012-04-02 08:08:26 +02:00
|
|
|
recipe = {
|
2013-04-28 12:40:08 +02:00
|
|
|
{"group:mesecon_conductor_craftable"},
|
|
|
|
{"default:stone"},
|
|
|
|
{"default:stick"},
|
2012-04-02 08:08:26 +02:00
|
|
|
}
|
|
|
|
})
|