1
0
mirror of https://github.com/D00Med/scifi_nodes.git synced 2024-12-23 00:20:17 +01:00

fixed check for Mesecons.

This commit is contained in:
A.C.M 2019-01-27 14:21:50 +01:00
parent c2775191ce
commit b642bc0af4

View File

@ -461,53 +461,6 @@ minetest.register_node("scifi_nodes:lightbar", {
sounds = default.node_sound_glass_defaults() sounds = default.node_sound_glass_defaults()
}) })
--wall switch, currently does not do anything
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,
selection_box = {
type = "wallmounted",
fixed = {-0.5, -0.3, -0.3, -0.45, 0.3, 0.3}
},
paramtype = "light",
paramtype2 = "wallmounted",
groups = {cracky=1, oddly_breakable_by_hand=1},
on_rightclick = function(pos, node, clicker, item, _)
minetest.set_node(pos, {name="scifi_nodes:switch_on", param2=node.param2})
end,
sounds = default.node_sound_glass_defaults()
})
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",
selection_box = {
type = "wallmounted",
fixed = {-0.5, -0.3, -0.3, -0.45, 0.3, 0.3}
},
paramtype = "light",
paramtype2 = "wallmounted",
light_source = 5,
groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1},
on_rightclick = function(pos, node, clicker, item, _)
minetest.set_node(pos, {name="scifi_nodes:switch_off", param2=node.param2})
end,
sounds = default.node_sound_glass_defaults()
})
--end of wall switch
minetest.register_node("scifi_nodes:light_dynamic", { minetest.register_node("scifi_nodes:light_dynamic", {
description = "Wall light", description = "Wall light",
tiles = { tiles = {
@ -1244,7 +1197,8 @@ minetest.register_node("scifi_nodes:windowpanel", {
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
if (mesecon.receptor_on ~= nil) and if (mesecon ~= nil) and
(mesecon.receptor_on ~= nil) and
(mesecon.receptor_off ~= nil) then (mesecon.receptor_off ~= nil) then
minetest.register_node("scifi_nodes:switch_off", { minetest.register_node("scifi_nodes:switch_off", {
description = "Wall switch", description = "Wall switch",
@ -1302,4 +1256,53 @@ if (mesecon.receptor_on ~= nil) and
} }
}) })
end else
--wall switch, currently does not do anything
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,
selection_box = {
type = "wallmounted",
fixed = {-0.5, -0.3, -0.3, -0.45, 0.3, 0.3}
},
paramtype = "light",
paramtype2 = "wallmounted",
groups = {cracky=1, oddly_breakable_by_hand=1},
on_rightclick = function(pos, node, clicker, item, _)
minetest.set_node(pos, {name="scifi_nodes:switch_on", param2=node.param2})
end,
sounds = default.node_sound_glass_defaults()
})
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",
selection_box = {
type = "wallmounted",
fixed = {-0.5, -0.3, -0.3, -0.45, 0.3, 0.3}
},
paramtype = "light",
paramtype2 = "wallmounted",
light_source = 5,
groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1},
on_rightclick = function(pos, node, clicker, item, _)
minetest.set_node(pos, {name="scifi_nodes:switch_off", param2=node.param2})
end,
sounds = default.node_sound_glass_defaults()
})
--end of wall switch
end -- if(mesecon.receptor ~= on