Remove empty else block, fix up mg_name and add mapgen check to water.lua

This commit is contained in:
teknomunk 2024-06-13 06:43:31 -05:00
parent 3b01fe20ba
commit ef58a9809a
3 changed files with 8 additions and 5 deletions

View file

@ -5,7 +5,6 @@ local NIGHT_VISION_RATIO = 0.45
-- Module state
local mods_loaded = false
local mg_name = minetest.get_mapgen_setting("mg_name")
function mcl_weather.set_sky_box_clear(player, sky, fog)
-- Make sure the player's head isn't in water before changing the skybox

View file

@ -1,6 +1,7 @@
local MINIMUM_LIGHT_LEVEL = 0.2
local VALID_SNOW_WEATHER_STATES = { snow = true, rain = true, thunder = true }
local VALID_RAIN_WEATHER_STATES = { rain = true, thunder = true }
local mg_name = minetest.get_mapgen_setting("mg_name")
local dimension_handlers = {}
mcl_weather.skycolor.dimension_handlers = dimension_handlers
@ -35,7 +36,6 @@ function dimension_handlers.overworld(player, sky_data)
if biome then
biomesky = biome._mcl_skycolor
biomefog = biome._mcl_fogcolor
else
end
end

View file

@ -1,5 +1,6 @@
local DEFAULT_WATER_COLOR = "#3F76E4"
local mg_name = minetest.get_mapgen_setting("mg_name")
local function water_sky(player, sky_data)
local water_color = DEFAULT_WATER_COLOR
@ -8,9 +9,12 @@ local function water_sky(player, sky_data)
if minetest.get_item_group(checkname, "water") == 0 then return end
local pos = player:get_pos()
local biome_index = minetest.get_biome_data(pos).biome
local biome_name = minetest.get_biome_name(biome_index)
local biome = minetest.registered_biomes[biome_name]
local biome = nil
if mg_name ~= "v6" and mg_name ~= "singlenode" then
local biome_index = minetest.get_biome_data(pos).biome
local biome_name = minetest.get_biome_name(biome_index)
biome = minetest.registered_biomes[biome_name]
end
if biome then water_color = biome._mcl_waterfogcolor end
if not biome then water_color = DEFAULT_WATER_COLOR end