From 0c8e5dc7a40985bb887c33bee955742cafa68e3e Mon Sep 17 00:00:00 2001 From: kay27 Date: Thu, 9 Dec 2021 02:55:57 +0400 Subject: [PATCH 1/2] Disable Nether portal node rotation by screwdriver --- mods/ITEMS/mcl_portals/portal_nether.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 3f15a134d..46025619c 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -237,6 +237,11 @@ local function destroy_nether_portal(pos, node) check_remove({x = pos.x, y = pos.y + 1, z = pos.z}) end +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.disallow +end + minetest.register_node(PORTAL, { description = S("Nether Portal"), _doc_items_longdesc = S("A Nether portal teleports creatures and objects to the hot and dangerous Nether dimension (and back!). Enter at your own risk!"), @@ -286,6 +291,7 @@ minetest.register_node(PORTAL, { groups = { creative_breakable = 1, portal = 1, not_in_creative_inventory = 1 }, sounds = mcl_sounds.node_sound_glass_defaults(), after_destruct = destroy_nether_portal, + on_rotate = on_rotate, _mcl_hardness = -1, _mcl_blast_resistance = 0, From 5a4abcbcb7d7aef5d61dbc54c9a783cd9b494ce7 Mon Sep 17 00:00:00 2001 From: chmodsayshello Date: Fri, 10 Dec 2021 13:59:31 +0000 Subject: [PATCH 2/2] fixed daylightsensor's register_abms By changing the check if a normal/inverted daylightsensor should update by turning on and off, I made them workling again --- 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..1c89293cc 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