From 9d77c22c4f9cc8c5ab23b71e9d6971d8768ebd69 Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 17 Dec 2021 03:04:36 +0400 Subject: [PATCH] Fix light --- mods/ENVIRONMENT/mcl_ambient_light/init.lua | 14 ++++++++------ mods/ENVIRONMENT/mcl_ambient_light/mod.conf | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_ambient_light/init.lua b/mods/ENVIRONMENT/mcl_ambient_light/init.lua index 11a11d4bc..1b030d1b9 100644 --- a/mods/ENVIRONMENT/mcl_ambient_light/init.lua +++ b/mods/ENVIRONMENT/mcl_ambient_light/init.lua @@ -1,11 +1,13 @@ minetest.register_on_mods_loaded(function () local light_min = 1 - for i, def in pairs(minetest.registered_nodes) do - local light_source = def.light_source - if light_source == nil or light_source < light_min then - minetest.override_item(i, { light_source = light_min }) - elseif light_source == light_min then - minetest.override_item(i, { light_source = light_min + 1 }) + for name, def in pairs(minetest.registered_nodes) do + if name ~= "air" then + local light_source = def.light_source + if light_source == nil or light_source < light_min then + minetest.override_item(name, { light_source = light_min }) + elseif light_source == light_min then + minetest.override_item(name, { light_source = light_min + 1 }) + end end end end) diff --git a/mods/ENVIRONMENT/mcl_ambient_light/mod.conf b/mods/ENVIRONMENT/mcl_ambient_light/mod.conf index f5e77b563..bccea6a89 100644 --- a/mods/ENVIRONMENT/mcl_ambient_light/mod.conf +++ b/mods/ENVIRONMENT/mcl_ambient_light/mod.conf @@ -1,3 +1,3 @@ name = ambient_light -author = MikeRedwood +author = MikeRedwood, kay27 description = Makes all nodes lit to a small degree!