Allow to disable weather changes
This commit is contained in:
parent
a3388e5288
commit
b9686c2d9f
2 changed files with 12 additions and 8 deletions
|
@ -19,9 +19,6 @@ mcl_weather.end_time = nil
|
|||
-- registered weathers
|
||||
mcl_weather.reg_weathers = {}
|
||||
|
||||
-- automaticly calculates intervals and swap weathers
|
||||
mcl_weather.auto_mode = true
|
||||
|
||||
-- global flag to disable/enable ABM logic.
|
||||
mcl_weather.allow_abm = true
|
||||
|
||||
|
@ -123,16 +120,20 @@ mcl_weather.get_random_pos_by_player_look_dir = function(player)
|
|||
end
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
if mcl_weather.auto_mode == false then
|
||||
return 0
|
||||
end
|
||||
|
||||
if mcl_weather.end_time == nil then
|
||||
mcl_weather.end_time = mcl_weather.get_rand_end_time()
|
||||
end
|
||||
-- recalculate weather
|
||||
if mcl_weather.end_time <= minetest.get_gametime() then
|
||||
local changeWeather = minetest.settings:get_bool("mcl_doWeatherCycle")
|
||||
if changeWeather == nil then
|
||||
changeWeather = true
|
||||
end
|
||||
if changeWeather then
|
||||
mcl_weather.set_random_weather(mcl_weather.state, mcl_weather.reg_weathers[mcl_weather.state])
|
||||
else
|
||||
mcl_weather.end_time = mcl_weather.get_rand_end_time()
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
|
|
@ -30,6 +30,9 @@ mcl_keepInventory (Keep inventory on death) bool false
|
|||
# If enabled, chat messages are shown to everyone when a player dies.
|
||||
mcl_showDeathMessages (Show death messages) bool true
|
||||
|
||||
# If enabled, the weather will change naturally over time.
|
||||
mcl_doWeatherCycle (Change weather) bool true
|
||||
|
||||
# If enabled, only peaceful mobs will appear naturally. This does not
|
||||
# affect monster spawners.
|
||||
# This setting is only read at startup.
|
||||
|
|
Reference in a new issue