From c2256bc4b76351e9778d37773b9c93392d0b9978 Mon Sep 17 00:00:00 2001 From: kay27 Date: Sun, 2 Jan 2022 03:16:05 +0400 Subject: [PATCH] Revert solar panel revert from MCL2 - more testing needed --- mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua b/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua index ed0e4c608..05fed31a3 100644 --- a/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua @@ -96,8 +96,9 @@ minetest.register_abm({ chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local light = minetest.get_node_light(pos, nil) + local time = minetest.get_us_time() - if light >= 12 and minetest.get_timeofday() > 0.2 and minetest.get_timeofday() < 0.8 then + if light >= 14 and time > 6000 then minetest.set_node(pos, {name="mesecons_solarpanel:solar_panel_on", param2=node.param2}) mesecon.receptor_on(pos, mesecon.rules.pplate) end @@ -111,8 +112,9 @@ minetest.register_abm({ chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local light = minetest.get_node_light(pos, nil) + local time = minetest.get_us_time() - if light < 12 then + if light < 14 and time > 18000 then minetest.set_node(pos, {name="mesecons_solarpanel:solar_panel_off", param2=node.param2}) mesecon.receptor_off(pos, mesecon.rules.pplate) end @@ -203,8 +205,9 @@ minetest.register_abm({ chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local light = minetest.get_node_light(pos, nil) + local time = minetest.get_us_time() - if light < 12 then + if light < 14 and time > 18000 then minetest.set_node(pos, {name="mesecons_solarpanel:solar_panel_inverted_on", param2=node.param2}) mesecon.receptor_on(pos, mesecon.rules.pplate) end @@ -218,8 +221,9 @@ minetest.register_abm({ chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local light = minetest.get_node_light(pos, nil) + local time = minetest.get_us_time() - if light >= 12 and minetest.get_timeofday() > 0.8 and minetest.get_timeofday() < 0.2 then + if light >= 14 and time > 6000 then minetest.set_node(pos, {name="mesecons_solarpanel:solar_panel_inverted_off", param2=node.param2}) mesecon.receptor_off(pos, mesecon.rules.pplate) end