Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- minetest.register_node("scifi_nodes:switch_off", {
- description = "Wall switch",
- tiles = {
- "scifi_nodes_switch_off.png",
- },
- inventory_image = "scifi_nodes_switch_on.png",
- wield_image = "scifi_nodes_switch_on.png",
- drawtype = "signlike",
- sunlight_propagates = true,
- node_box = {
- type = "wallmounted",
- },
- selection_box = {
- type = "wallmounted",
- },
- paramtype = "light",
- paramtype2 = "wallmounted",
- groups = {cracky=1, oddly_breakable_by_hand=1, mesecon_needs_receiver = 1},
- on_rightclick = function(pos, node, clicker, item, _)
- minetest.sound_play("scifi_nodes_digicode", {max_hear_distance = 8, pos = pos, gain = 1.0})
- minetest.swap_node(pos, {name="scifi_nodes:switch_on", param2=node.param2})
- minetest.get_node_timer(pos):start(3)
- end,
- sounds = default.node_sound_glass_defaults(),
- mesecons = {
- receptor = {
- state = mesecon.state.off,
- rules = {
- {x=1, y=-1, z=0},
- {x=-1, y=-1, z=0},
- {x=0, y=-1, z=1},
- {x=0, y=-1, z=-1}
- }
- }
- },
- })
- minetest.register_node("scifi_nodes:switch_on", {
- description = "Wall switch",
- sunlight_propagates = true,
- tiles = {
- "scifi_nodes_switch_on.png",
- },
- inventory_image = "scifi_nodes_switch_on.png",
- wield_image = "scifi_nodes_switch_on.png",
- drawtype = "signlike",
- node_box = {
- type = "wallmounted",
- },
- selection_box = {
- type = "wallmounted",
- },
- paramtype = "light",
- paramtype2 = "wallmounted",
- light_source = 5,
- groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1, mesecon_needs_receiver = 1},
- on_rightclick = function(pos, node, clicker, item, _)
- minetest.swap_node(pos, {name="scifi_nodes:switch_off", param2=node.param2})
- mesecon.receptor_off(pos)
- end,
- on_timer = function(pos, node, clicker, item, _)
- minetest.swap_node(pos, {name="scifi_nodes:switch_off", param2=node.param2})
- mesecon.receptor_off(pos)
- end,
- sounds = default.node_sound_glass_defaults(),
- mesecons = {
- receptor = {
- state = mesecon.state.on,
- rules = {
- {x=1, y=-1, z=0},
- {x=-1, y=-1, z=0},
- {x=0, y=-1, z=1},
- {x=0, y=-1, z=-1}
- }
- }
- },
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement