diff --git a/mods/ENVIRONMENT/mcl_weather/init.lua b/mods/ENVIRONMENT/mcl_weather/init.lua index 448722a9..a646a790 100644 --- a/mods/ENVIRONMENT/mcl_weather/init.lua +++ b/mods/ENVIRONMENT/mcl_weather/init.lua @@ -21,7 +21,7 @@ local interval=1 function mcl_weather.register_weather(name,def) mcl_weather.registered_weathers[name] = def end - +local modpath=minetest.get_modpath(minetest.get_current_modname()) dofile(modpath.."/skycolor.lua") dofile(modpath.."/snow.lua") dofile(modpath.."/rain.lua") @@ -35,6 +35,19 @@ function mcl_weather.get_weatherdef(name) return mcl_weather.registered_weathers["none"] end +function mcl_weather.get_weather() + return mcl_weather.current +end + +function mcl_weather.get_current_light_factor() + local lf = mcl_weather.get_weatherdef(mcl_weather.current).light_factor + if mcl_weather.current == "none" or not lf then + return nil + else + return lf + end +end + -- Returns true if pos is outdoor. -- Outdoor is defined as any node in the Overworld under open sky. -- FIXME: Nodes below glass also count as “outdoor”, this should not be the case.