Use new API to disable MTG weather

This commit is contained in:
Till Affeldt 2024-09-27 00:53:30 +02:00
parent 8e3ce58015
commit 8b846b23dc
2 changed files with 13 additions and 7 deletions

View File

@ -46,12 +46,18 @@ climate_mod.settings = {
climate_mod.i18n = minetest.get_translator("climate_api")
-- warn about clouds being overriden by MTG weather
if climate_mod.settings.skybox and minetest.get_modpath("weather") and minetest.settings:get_bool("enable_weather") then
-- attempt to disable MTG weather mod
if climate_mod.settings.skybox and minetest.get_modpath("weather") then
if weather ~= nil and weather.get ~= nil then
weather.get = function(player)
return {}
end
elseif minetest.settings:get_bool("enable_weather") then
-- old version with no API support
-- warn about clouds being overriden by MTG weather
minetest.log("warning", "[Regional Weather] " ..
climate_mod.i18n("Disable MTG weather for the best experience. Check the forum for more information."))
-- try to disable MTG weather. may or may not work depending on load order
minetest.settings:set_bool("enable_weather", false)
end
end
-- initialize empty registers

View File

@ -2,7 +2,7 @@ name = climate_api
title = Climate API
author = TestificateMods
depends = lighting_monoid
optional_depends = player_monoids, playerphysics, pova
optional_depends = player_monoids, playerphysics, pova, weather
description = """
A powerful engine for weather presets and visual effects.
Use the regional climate to set up different effects for different regions.