diff options
author | Alexander Weber <web.alexander@web.de> | 2017-06-16 23:00:36 +0200 |
---|---|---|
committer | Alexander Weber <web.alexander@web.de> | 2017-06-16 23:00:36 +0200 |
commit | 28d28390ce5d67f47db184cbbbc4ecd74be77eb2 (patch) | |
tree | 2dde0e088559a878d6006fa3f3779b5ac3adb1b0 /init.lua | |
parent | b267cf26579623565f5a85bee9e8584a5467a85f (diff) |
started work on skin_meta_api
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -9,6 +9,7 @@ skins = {} skins.modpath = minetest.get_modpath(minetest.get_current_modname()) skins.default = "character_1" +dofile(skins.modpath.."skin_meta_api.lua") dofile(skins.modpath.."/api.lua") dofile(skins.modpath.."/skinlist.lua") @@ -20,3 +21,15 @@ end if minetest.get_modpath("sfinv") then dofile(skins.modpath.."/sfinv_page.lua") end + +-- 3d_armor compatibility +if minetest.global_exists("armor") then + armor.get_player_skin = function(self, name) + local skin = skins.get_player_skin(minetest.get_player_by_name(name)) + return skin:get_meta("_key") --3d_armor adds a ".png" but it should be compatible in most cases + end + armor.get_preview = function(self, name) + local skin = skins.get_player_skin(minetest.get_player_by_name(name)) + return skin:get_meta("preview") + end +end |