diff --git a/mods/ENVIRONMENT/mcl_weather/skycolor.lua b/mods/ENVIRONMENT/mcl_weather/skycolor.lua index 8618bdbb7f..6cc94b5c1b 100644 --- a/mods/ENVIRONMENT/mcl_weather/skycolor.lua +++ b/mods/ENVIRONMENT/mcl_weather/skycolor.lua @@ -55,9 +55,13 @@ mcl_weather.skycolor = { -- Wrapper for updating day/night ratio that respects night vision override_day_night_ratio = function(player, ratio) local meta = player:get_meta() - local night_vision = meta:get_int("night_vision") + local has_night_vision = meta:get_int("night_vision") == 1 local arg - if night_vision == 1 then + -- Apply night vision only for dark sky + local is_dark = minetest.get_timeofday() > 0.8 or minetest.get_timeofday() < 0.2 or mcl_weather.state ~= "none" + local pos = player:get_pos() + local dim = mcl_worlds.pos_to_dimension(pos) + if has_night_vision and is_dark and dim ~= "nether" and dim ~= "end" then if ratio == nil then arg = NIGHT_VISION_RATIO else