Initial commit

This commit is contained in:
commit 9caec04417
5 changed files with 33 additions and 0 deletions

3
README.md Normal file
View File

@ -0,0 +1,3 @@
This mod is used to put custom skins in MineClone2 0.84 or greater.
Place PNG skin files in the textures folder. If the skin should be used with the slim-armed player mesh, include a complimentary file in the `meta` directory. The file in the meta directory should have the same name as the texture with the file extension changed to `.txt`. Add the line to the file `gender="female",`.

24
init.lua Normal file
View File

@ -0,0 +1,24 @@
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

2
meta/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = mcl_custom_skins
depends = mcl_skins

2
textures/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore