diff options
author | Lejo <Lejo_1@web.de> | 2018-06-30 16:15:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-30 16:15:57 +0200 |
commit | 2cff7234e017487934d1d1e95f6a312b41835e0d (patch) | |
tree | 7bdfb3e82186608d7df8581549b901962dd6874e | |
parent | 2900d789af3e56fb07695cf140a2a86aee279801 (diff) |
Use Mod_storage
-rw-r--r-- | api.lua | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,6 +1,8 @@ -- get current skin +local storage = minetest.get_mod_storage() + function skins.get_player_skin(player) - local skin = player:get_attribute("skinsdb:skin_key") + local skin = storage:get_string(player:get_player_name()) return skins.get(skin) or skins.get(skins.default) end @@ -22,7 +24,7 @@ function skins.assign_player_skin(player, skin) if skin_key == skins.default then skin_key = "" end - player:set_attribute("skinsdb:skin_key", skin_key) + storage:set_string(player:get_player_name(), skin_key) else return false end |