Fix deprecated get/set_attribute calls (#9)

This commit is contained in:
Droog71 2022-01-02 14:39:21 -05:00 committed by GitHub
parent c500257c0d
commit 7bb3e01547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,7 @@ skybox.set = function(player, number)
player:set_sky(sky[2], "skybox", textures, true)
end
player:set_clouds(sky[4])
player:set_attribute("skybox:skybox", sky[1])
player:get_meta():set_string("skybox:skybox", sky[1])
end
end
@ -86,7 +86,7 @@ skybox.clear = function(player)
player:set_moon({visible = true})
player:set_stars({visible = true})
player:set_attribute("skybox:skybox", "off")
player:get_meta():set_string("skybox:skybox", "off")
end
skybox.add = function(def)
@ -102,7 +102,7 @@ end
--
minetest.register_on_joinplayer(function(player)
local sky = player:get_attribute("skybox:skybox")
local sky = player:get_meta():get_string("skybox:skybox")
if not sky or sky == "" then
skybox.clear(player)
else