From bb496db60557f07f9a6c09370158068b2bdff050 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 31 Jul 2022 04:46:06 +0200 Subject: [PATCH] use _mcl_biome_type for weather --- mods/ENVIRONMENT/mcl_weather/rain.lua | 5 +---- mods/ENVIRONMENT/mcl_weather/snow.lua | 11 +++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_weather/rain.lua b/mods/ENVIRONMENT/mcl_weather/rain.lua index 7356f11af..dd8ff0b74 100644 --- a/mods/ENVIRONMENT/mcl_weather/rain.lua +++ b/mods/ENVIRONMENT/mcl_weather/rain.lua @@ -44,10 +44,7 @@ local textures = {"weather_pack_rain_raindrop_1.png", "weather_pack_rain_raindro function mcl_weather.has_rain(pos) if not mcl_worlds.has_weather(pos) then return false end if mgname == "singlenode" or mgname == "v6" then return true end - local bd = minetest.get_biome_data(pos) - local bn = minetest.get_biome_name(bd.biome) - if not mcl_worlds.has_weather(pos) or bn:find("Desert") or bd.heat > 85 then - return false end + if minetest.registered_biomes[minetest.get_biome_name(minetest.get_biome_data(pos).biome)]._mcl_biome_type == "hot" then return false end return true end diff --git a/mods/ENVIRONMENT/mcl_weather/snow.lua b/mods/ENVIRONMENT/mcl_weather/snow.lua index f94ac0695..6f396857c 100644 --- a/mods/ENVIRONMENT/mcl_weather/snow.lua +++ b/mods/ENVIRONMENT/mcl_weather/snow.lua @@ -66,12 +66,11 @@ function mcl_weather.has_snow(pos) if mgname == "singlenode" or mgname == "v6" then return true end local bd = minetest.get_biome_data(pos) local bn = minetest.get_biome_name(bd.biome) - local minheight = -64 - if bn:find("Taiga") then minheight = 100 end - if bn:find("ColdTaiga") then minheight = 0 end - if bn:find("MegaSpruce") then minheight = 140 end - if pos.y < minheight then return false end - if table.indexof(snow_biomes,bn) ~= -1 then return true end + if minetest.registered_biomes[bn]._mcl_biome_type == "snowy" then return true end + if minetest.registered_biomes[bn]._mcl_biome_type == "cold" then + if bn == "Taiga" and pos.y > 140 then return true end + if bn == "MegaSpruceTaiga" and pos.y > 100 then return true end + end return false end