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") climate_mod.i18n = minetest.get_translator("climate_api")
-- warn about clouds being overriden by MTG weather -- attempt to disable MTG weather mod
if climate_mod.settings.skybox and minetest.get_modpath("weather") and minetest.settings:get_bool("enable_weather") then if climate_mod.settings.skybox and minetest.get_modpath("weather") then
minetest.log("warning", "[Regional Weather] " .. if weather ~= nil and weather.get ~= nil then
climate_mod.i18n("Disable MTG weather for the best experience. Check the forum for more information.")) weather.get = function(player)
-- try to disable MTG weather. may or may not work depending on load order return {}
minetest.settings:set_bool("enable_weather", false) 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."))
end
end end
-- initialize empty registers -- initialize empty registers

View File

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