From 6281dc744dc3951234931a9f44c3bdd353f79df7 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 27 Oct 2017 15:13:31 -0400 Subject: updated boost cart, homedecor modpack, castles modpack, currency, farming-redo, maptools, mesecons, moreblocks, moreores, pipeworks, quartz --- mesecons_solarpanel/init.lua | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'mesecons_solarpanel') diff --git a/mesecons_solarpanel/init.lua b/mesecons_solarpanel/init.lua index bc5a408..9981d95 100644 --- a/mesecons_solarpanel/init.lua +++ b/mesecons_solarpanel/init.lua @@ -24,8 +24,10 @@ minetest.register_node("mesecons_solarpanel:solar_panel_on", { groups = {dig_immediate=3, not_in_creative_inventory = 1}, sounds = default.node_sound_glass_defaults(), mesecons = {receptor = { - state = mesecon.state.on - }} + state = mesecon.state.on, + rules = mesecon.rules.wallmounted_get, + }}, + on_blast = mesecon.on_blastnode, }) -- Solar Panel @@ -51,11 +53,13 @@ minetest.register_node("mesecons_solarpanel:solar_panel_off", { wall_side = { -8/16, -7/16, -7/16, -7/16, 7/16, 7/16 }, }, groups = {dig_immediate=3}, - description="Solar Panel", + description = "Solar Panel", sounds = default.node_sound_glass_defaults(), mesecons = {receptor = { - state = mesecon.state.off - }} + state = mesecon.state.off, + rules = mesecon.rules.wallmounted_get, + }}, + on_blast = mesecon.on_blastnode, }) minetest.register_craft({ @@ -74,8 +78,9 @@ minetest.register_abm( local light = minetest.get_node_light(pos, nil) if light >= 12 then - minetest.set_node(pos, {name="mesecons_solarpanel:solar_panel_on", param2=node.param2}) - mesecon.receptor_on(pos) + node.name = "mesecons_solarpanel:solar_panel_on" + minetest.swap_node(pos, node) + mesecon.receptor_on(pos, mesecon.rules.wallmounted_get(node)) end end, }) @@ -88,8 +93,9 @@ minetest.register_abm( local light = minetest.get_node_light(pos, nil) if light < 12 then - minetest.set_node(pos, {name="mesecons_solarpanel:solar_panel_off", param2=node.param2}) - mesecon.receptor_off(pos) + node.name = "mesecons_solarpanel:solar_panel_off" + minetest.swap_node(pos, node) + mesecon.receptor_off(pos, mesecon.rules.wallmounted_get(node)) end end, }) -- cgit v1.2.3