1
0
Fork 0

fix end sky and void crash

This commit is contained in:
cora 2022-08-02 11:37:43 +02:00
parent a2b003a195
commit 4b5476dbff
3 changed files with 6 additions and 4 deletions

View File

@ -177,7 +177,9 @@ function mcl_weather.rain.make_weather()
if mcl_weather.is_underwater(player) or not mcl_weather.has_rain(pos) then
mcl_weather.rain.remove_sound(player)
mcl_weather.remove_spawners_player(player)
mcl_weather.set_sky_box_clear(player)
if mcl_worlds.has_weather(pos) then
mcl_weather.set_sky_box_clear(player)
end
else
if mcl_weather.has_snow(pos) then
mcl_weather.rain.remove_sound(player)

View File

@ -95,7 +95,7 @@ mcl_weather.skycolor = {
for _, player in ipairs(players) do
local pos = player:get_pos()
local dim = mcl_worlds.pos_to_dimension(pos)
local has_weather = ((mcl_weather.state == "snow" or mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_snow(pos)) or ((mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_rain(pos))
local has_weather = (mcl_worlds.has_weather(pos) and (mcl_weather.state == "snow" or mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_snow(pos)) or ((mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_rain(pos))
if dim == "overworld" then
if (mcl_weather.state == "none") then
-- Clear weather

View File

@ -66,8 +66,8 @@ function mcl_weather.has_snow(pos)
if mgname == "singlenode" or mgname == "v6" then return false end
local bn = minetest.get_biome_name(minetest.get_biome_data(pos).biome)
local bd = minetest.registered_biomes[bn]
if bd._mcl_biome_type == "snowy" then return true end
if bd._mcl_biome_type == "cold" then
if bd and bd._mcl_biome_type == "snowy" then return true end
if bd and bd._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