improved skinsdb compatibility and fix on skins
This commit is contained in:
parent
07e2cf36fa
commit
9899cdd2d9
@ -30,15 +30,15 @@ function airutils.set_player_skin(player, skin)
|
||||
texture = texture[1]
|
||||
if skinsdb_mod_path then
|
||||
local skdb_skin = skins.get_player_skin(player)
|
||||
texture = "[combine:64x32:0,0="..skdb_skin._texture..":0,0="..skin.."]"
|
||||
else
|
||||
texture = "[combine:64x32:0,0="..skdb_skin._texture --..":0,0="..skin
|
||||
end
|
||||
|
||||
--backup current texture
|
||||
if player:get_attribute(backup) == nil or player:get_attribute(backup) == "" then
|
||||
player:set_attribute(backup, texture) --texture backup
|
||||
else
|
||||
texture = player:get_attribute(backup)
|
||||
end
|
||||
end
|
||||
|
||||
--combine the texture
|
||||
texture = texture.."^"..skin
|
||||
@ -54,8 +54,8 @@ function airutils.set_player_skin(player, skin)
|
||||
})
|
||||
else
|
||||
set_player_textures(player, {texture})
|
||||
player:set_attribute(curr_skin, texture)
|
||||
end
|
||||
player:set_attribute(curr_skin, texture)
|
||||
end
|
||||
else
|
||||
--remove texture
|
||||
@ -124,8 +124,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
end
|
||||
end)
|
||||
|
||||
if not skinsdb_mod_path then -- If not managed by skinsdb
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local skin = player:get_attribute(curr_skin)
|
||||
|
||||
@ -137,4 +135,3 @@ if not skinsdb_mod_path then -- If not managed by skinsdb
|
||||
end, player, skin)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
Binary file not shown.
Before (image error) Size: 8.9 KiB After (image error) Size: 8.9 KiB |
Binary file not shown.
Before (image error) Size: 8.7 KiB After (image error) Size: 8.7 KiB |
Loading…
x
Reference in New Issue
Block a user