forked from Mineclonia/Mineclonia
fix incompatibility with old mcl_weather
This commit is contained in:
parent
bb0f33e21b
commit
b5b249b722
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue