mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2024-12-25 08:50:18 +01:00
api.lua: Fix deprecation warnings
This commit is contained in:
parent
63555ed0be
commit
3aebed6fed
8
api.lua
8
api.lua
@ -2,9 +2,11 @@
|
|||||||
local storage = minetest.get_mod_storage()
|
local storage = minetest.get_mod_storage()
|
||||||
|
|
||||||
function skins.get_player_skin(player)
|
function skins.get_player_skin(player)
|
||||||
if player:get_attribute("skinsdb:skin_key") then
|
local meta = player:get_meta()
|
||||||
storage:set_string(player:get_player_name(), player:get_attribute("skinsdb:skin_key"))
|
if meta:get("skinsdb:skin_key") then
|
||||||
player:set_attribute("skinsdb:skin_key", nil)
|
-- Move player data prior July 2018 to mod storage
|
||||||
|
storage:set_string(player:get_player_name(), player:get_string("skinsdb:skin_key"))
|
||||||
|
meta:set_string("skinsdb:skin_key", "")
|
||||||
end
|
end
|
||||||
local skin = storage:get_string(player:get_player_name())
|
local skin = storage:get_string(player:get_player_name())
|
||||||
return skins.get(skin) or skins.get(skins.default)
|
return skins.get(skin) or skins.get(skins.default)
|
||||||
|
Loading…
Reference in New Issue
Block a user