Use new set_sky API to eliminate deprecated warnings. (#4)
From minetest-mods/skybox/#4
This commit is contained in:
parent
05106b1919
commit
b07f74eaff
@ -48,14 +48,24 @@ skybox.set = function(player, number)
|
||||
return
|
||||
end
|
||||
player:override_day_night_ratio(sky[3])
|
||||
player:set_sky(sky[2], "skybox", {
|
||||
local textures = {
|
||||
sky[1] .. "Up.jpg",
|
||||
sky[1] .. "Down.jpg",
|
||||
sky[1] .. "Front.jpg",
|
||||
sky[1] .. "Back.jpg",
|
||||
sky[1] .. "Left.jpg",
|
||||
sky[1] .. "Right.jpg",
|
||||
}, true)
|
||||
}
|
||||
if player.get_sky_color ~= nil then
|
||||
player:set_sky({
|
||||
base_color = sky[2],
|
||||
type = "skybox",
|
||||
textures = textures,
|
||||
clouds = true
|
||||
})
|
||||
else
|
||||
player:set_sky(sky[2], "skybox", textures, true)
|
||||
end
|
||||
player:set_clouds(sky[4])
|
||||
end
|
||||
end
|
||||
@ -65,7 +75,11 @@ skybox.clear = function(player)
|
||||
return
|
||||
end
|
||||
player:override_day_night_ratio(nil)
|
||||
if player.get_sky_color ~= nil then
|
||||
player:set_sky({base_color = "white", type = "regular"})
|
||||
else
|
||||
player:set_sky("white", "regular")
|
||||
end
|
||||
player:set_clouds({
|
||||
density = 0.4,
|
||||
color = "#fff0f0e5",
|
||||
|
Loading…
x
Reference in New Issue
Block a user