diff options
author | Alexander Weber <web.alexander@web.de> | 2017-06-16 21:40:54 +0200 |
---|---|---|
committer | Alexander Weber <web.alexander@web.de> | 2017-06-16 21:40:54 +0200 |
commit | b267cf26579623565f5a85bee9e8584a5467a85f (patch) | |
tree | 67cb167485d31eb17ef6a187ab9416e367a88409 /players.lua | |
parent | dcd0a744cb4bd8398dfe528a26f65e4e8936cc8e (diff) |
renamed players.lua -> api.lua; some cleanups
Diffstat (limited to 'players.lua')
-rw-r--r-- | players.lua | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/players.lua b/players.lua deleted file mode 100644 index 5b161bd..0000000 --- a/players.lua +++ /dev/null @@ -1,40 +0,0 @@ --- get current skin -skins.get_player_skin = function(player) - local skin = player:get_attribute("skin") - if not skins.is_skin(skin) then - skin = skins.default - end - return skin -end - --- Set skin -skins.set_player_skin = function(player, skin) - if skin == skins.default then - skin = "" - end - player:set_attribute("skin", skin) - skins.update_player_skin(player) -end - --- update visuals -skins.update_player_skin = function(player) - local skin = skins.get_player_skin(player) - player:set_properties({ - textures = {skins.textures[skin]}, - }) -end - --- Update skin on join -minetest.register_on_joinplayer(function(player) - skins.update_player_skin(player) -end) - --- 3d_armor compatibility -if minetest.global_exists("armor") then - armor.get_player_skin = function(self, name) - return skins.get_player_skin(minetest.get_player_by_name(name)) - end - armor.get_preview = function(self, name) - return skins.preview[skins.get_player_skin(minetest.get_player_by_name(name))] - end -end |