diff --git a/3d_armor/armor.lua b/3d_armor/armor.lua index 1083837..ba3a364 100644 --- a/3d_armor/armor.lua +++ b/3d_armor/armor.lua @@ -82,6 +82,14 @@ elseif minetest.get_modpath("unified_inventory") then }) end +if minetest.get_modpath("skins") then + skin_mod = "skins" +elseif minetest.get_modpath("simple_skins") then + skin_mod = "simple_skins" +elseif minetest.get_modpath("u_skins") then + skin_mod = "u_skins" +end + armor.def = { state = 0, count = 0, @@ -266,7 +274,7 @@ armor.get_player_skin = function(self, name) end armor.get_preview = function(self, name) - if skin_mod == "skins" or skin_mod == "u_skins" then + if skin_mod == "skins" then return armor:get_player_skin(name).."_preview.png" end end @@ -423,20 +431,17 @@ minetest.register_on_joinplayer(function(player) wielditem = "3d_armor_trans.png", preview = armor.default_skin.."_preview.png", } - if minetest.get_modpath("skins") then - skin_mod = "skins" + if skin_mod == "skins" then local skin = skins.skins[name] if skin and skins.get_type(skin) == skins.type.MODEL then armor.textures[name].skin = skin..".png" end - elseif minetest.get_modpath("simple_skins") then - skin_mod = "simple_skins" + elseif skin_mod == "simple_skins" then local skin = skins.skins[name] if skin then armor.textures[name].skin = skin..".png" end - elseif minetest.get_modpath("u_skins") then - skin_mod = "u_skins" + elseif skin_mod == "u_skins" then local skin = u_skins.u_skins[name] if skin and u_skins.get_type(skin) == u_skins.type.MODEL then armor.textures[name].skin = skin..".png"