Compare commits

...

4 Commits

Author SHA1 Message Date
FossFanatic 0fef161580 revert 49e420e1e8
revert Add debug daytime sky and fog colours, remove biome specific dawn/dusk and night colours
2022-12-21 12:22:24 +00:00
FossFanatic 49e420e1e8 Add debug daytime sky and fog colours, remove biome specific dawn/dusk and night colours 2022-12-21 12:21:23 +00:00
cora 1257ff25d3 Add color to example biome (Plains) 2022-10-21 16:28:54 +02:00
cora 6c127eb170 Add support for biome specific sky- and fogcolor
_mcl_skycolor and _mcl_fogcolor in biomedef
2022-10-21 16:28:13 +02:00
2 changed files with 30 additions and 7 deletions

View File

@ -1,17 +1,30 @@
local mods_loaded = false
local NIGHT_VISION_RATIO = 0.45
function mcl_weather.set_sky_box_clear(player)
player:set_sky({
type = "regular",
sky_color = {
local mg_name = minetest.get_mapgen_setting("mg_name")
function mcl_weather.set_sky_box_clear(player,sky,fog)
local sc = {
day_sky = "#92B9FF",
day_horizon = "#B4D0FF",
day_horizon = "#C0D8FF",
dawn_sky = "#B4BAFA",
dawn_horizon = "#BAC1F0",
night_sky = "#006AFF",
night_horizon = "#4090FF",
},
}
if sky then
sc.day_sky = sky
sc.dawn_sky = sky
sc.night_sky = sky
end
if fog then
sc.day_horizon = fog
sc.dawn_horizon = fog
sc.night_horizon = fog
end
player:set_sky({
type = "regular",
sky_color = sc,
clouds = true,
})
end
@ -97,9 +110,17 @@ mcl_weather.skycolor = {
local dim = mcl_worlds.pos_to_dimension(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
local biomesky
local biomefog
if mg_name ~= "v6" and mg_name ~= "singlenode" then
local biome = minetest.get_biome_name(minetest.get_biome_data(player:get_pos()).biome)
biomesky = minetest.registered_biomes[biome]._mcl_skycolor
biomefog = minetest.registered_biomes[biome]._mcl_fogcolor
end
if (mcl_weather.state == "none") then
-- Clear weather
mcl_weather.set_sky_box_clear(player)
mcl_weather.set_sky_box_clear(player,biomesky,biomefog)
player:set_sun({visible = true, sunrise_visible = true})
player:set_moon({visible = true})
player:set_stars({visible = true})

View File

@ -517,6 +517,8 @@ local function register_biomes()
heat_point = 58,
_mcl_biome_type = "medium",
_mcl_palette_index = 0,
_mcl_skycolor = "#78A7FF",
_mcl_fogcolor = "#C0D8FF"
})
minetest.register_biome({
name = "Plains_beach",