Update magic wand
[minetest_hades/hades_revisited.git] / mods / mesecons / mesecons_switch / init.lua
blob9360bbf5eec32f69e203c19ea1335dea0ceeb0b9
1 -- MESECON_SWITCH
3 minetest.register_node("mesecons_switch:mesecon_switch_off", {
4 tiles = {"jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_off.png"},
5 paramtype2="facedir",
6 groups = {dig_immediate=2},
7 description="Switch",
8 sounds = hades_sounds.node_sound_stone_defaults(),
9 mesecons = {receptor = {
10 state = mesecon.state.off
11 }},
12 on_punch = function(pos, node)
13 minetest.swap_node(pos, {name = "mesecons_switch:mesecon_switch_on", param2 = node.param2})
14 mesecon:receptor_on(pos)
15 minetest.sound_play("mesecons_switch", {pos=pos}, true)
16 end
19 minetest.register_node("mesecons_switch:mesecon_switch_on", {
20 tiles = {"jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_on.png"},
21 paramtype2="facedir",
22 groups = {dig_immediate=2,not_in_creative_inventory=1},
23 drop="mesecons_switch:mesecon_switch_off 1",
24 sounds = hades_sounds.node_sound_stone_defaults(),
25 mesecons = {receptor = {
26 state = mesecon.state.on
27 }},
28 on_punch = function(pos, node)
29 minetest.swap_node(pos, {name = "mesecons_switch:mesecon_switch_off", param2 = node.param2})
30 mesecon:receptor_off(pos)
31 minetest.sound_play("mesecons_switch", {pos=pos}, true)
32 end
35 minetest.register_craft({
36 output = "mesecons_switch:mesecon_switch_off 2",
37 recipe = {
38 {"hades_core:steel_ingot", "hades_core:cobble", "hades_core:steel_ingot"},
39 {"group:mesecon_conductor_craftable","", "group:mesecon_conductor_craftable"},