mirror of
https://github.com/APercy/airutils.git
synced 2025-03-23 11:22:20 +00:00
added skinsdb ugly workaround
This commit is contained in:
parent
753243c84e
commit
6b5e263a4c
1 changed files with 26 additions and 8 deletions
|
@ -6,11 +6,6 @@ minetest.register_chatcommand("au_uniform", {
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
|
|
||||||
if skinsdb_mod_path then
|
|
||||||
minetest.chat_send_player(name, "This tool is incompatible with skinsdb.")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if player then
|
if player then
|
||||||
airutils.uniform_formspec(name)
|
airutils.uniform_formspec(name)
|
||||||
else
|
else
|
||||||
|
@ -31,6 +26,10 @@ function airutils.set_player_skin(player, skin)
|
||||||
if texture then
|
if texture then
|
||||||
if skin then
|
if skin then
|
||||||
texture = texture[1]
|
texture = texture[1]
|
||||||
|
if skinsdb_mod_path then
|
||||||
|
texture = "character.png"
|
||||||
|
end
|
||||||
|
|
||||||
if player:get_attribute(backup) == nil or player:get_attribute(backup) == "" then
|
if player:get_attribute(backup) == nil or player:get_attribute(backup) == "" then
|
||||||
player:set_attribute(backup, texture) --texture backup
|
player:set_attribute(backup, texture) --texture backup
|
||||||
--minetest.chat_send_all(dump(player:get_attribute(backup)))
|
--minetest.chat_send_all(dump(player:get_attribute(backup)))
|
||||||
|
@ -39,7 +38,16 @@ function airutils.set_player_skin(player, skin)
|
||||||
end
|
end
|
||||||
texture = texture.."^"..skin
|
texture = texture.."^"..skin
|
||||||
if texture ~= nil and texture ~= "" then
|
if texture ~= nil and texture ~= "" then
|
||||||
set_player_textures(player, { texture })
|
if skinsdb_mod_path then
|
||||||
|
player:set_properties({
|
||||||
|
visual = "mesh",
|
||||||
|
visual_size = {x=1, y=1},
|
||||||
|
mesh = "character.b3d",
|
||||||
|
textures = {texture},
|
||||||
|
})
|
||||||
|
else
|
||||||
|
set_player_textures(player, { texture })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local old_texture = player:get_attribute(backup)
|
local old_texture = player:get_attribute(backup)
|
||||||
|
@ -59,8 +67,18 @@ function airutils.set_player_skin(player, skin)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--minetest.chat_send_all(dump(old_texture))
|
--minetest.chat_send_all(dump(old_texture))
|
||||||
if old_texture ~= nil and old_texture ~= "" then
|
if skinsdb_mod_path then
|
||||||
set_player_textures(player, { old_texture })
|
player:set_properties({
|
||||||
|
visual = "mesh",
|
||||||
|
visual_size = {x=1, y=1},
|
||||||
|
mesh = "skinsdb_3d_armor_character_5.b3d",
|
||||||
|
textures = {texture},
|
||||||
|
})
|
||||||
|
skins.set_player_skin(player, skins.get_player_skin(player))
|
||||||
|
else
|
||||||
|
if old_texture ~= nil and old_texture ~= "" then
|
||||||
|
set_player_textures(player, { old_texture })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
player:set_attribute(backup, nil)
|
player:set_attribute(backup, nil)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue