mcl_custom_skins/init.lua

29 lines
821 B
Lua

if not mcl_skins or not mcl_skins.register_simple_skin then
minetest.log("warning", "[mcl_custom_skins] mcl_skins.register_simple_skin() does not exist. Most likely MineClone needs to be updated.")
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