25 lines
680 B
Lua
25 lines
680 B
Lua
if not mcl_skins or not mcl_skins.register_simple_skin then return end
|
|
local mod_path = minetest.get_modpath("mcl_custom_skins")
|
|
local textures = minetest.get_dir_list(mod_path .. "/textures")
|
|
table.sort(textures)
|
|
for i, texture in pairs(textures) do
|
|
if texture:find(".png$") then
|
|
local f = io.open(mod_path .. "/meta/" .. texture:gsub("png$", "txt"))
|
|
local slim_arms
|
|
if f then
|
|
local data = f:read("*all")
|
|
if data then
|
|
data = minetest.deserialize("return {" .. data .. "}")
|
|
if data then
|
|
slim_arms = data.gender == "female"
|
|
end
|
|
end
|
|
f:close()
|
|
end
|
|
mcl_skins.register_simple_skin({
|
|
texture = texture,
|
|
slim_arms = slim_arms,
|
|
})
|
|
end
|
|
end
|