Add uv wrapped 1.8 hand model (#74)

This commit is contained in:
ZyuzlyaevPavel 2022-10-06 02:15:03 +07:00 committed by GitHub
parent b769824d24
commit e275159dd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 5 deletions

3
API.md
View File

@ -59,7 +59,8 @@ Could be redefined for dynamic texture generation
Set the hand node to be used with this skin
## skin:set_hand_from_texture()
Register and set hand node based on skin texture
Register and set hand node based on skin texture.
Uses different model depending on get_meta("format") ("1.0" or "1.8")
Only works on mod load
## skin:get_hand()

BIN
models/skinsdb_hand_18.b3d Normal file

Binary file not shown.

Binary file not shown.

View File

@ -69,7 +69,11 @@ function skin_class:set_hand_from_texture()
hand_def.wield_scale = {x=1,y=1,z=1}
hand_def.paramtype = "light"
hand_def.drawtype = "mesh"
hand_def.mesh = "skinsdb_hand.b3d"
if(self:get_meta("format") == "1.0") then
hand_def.mesh = "skinsdb_hand.b3d"
else
hand_def.mesh = "skinsdb_hand_18.b3d"
end
hand_def.use_texture_alpha = ALPHA_CLIP
minetest.register_node(hand, hand_def)
self:set_hand(hand)

View File

@ -51,9 +51,7 @@ for _, fn in pairs(skins_dir_list) do
local skin_format = skins.get_skin_format(file)
skin_obj:set_meta("format", skin_format)
file:close()
if skin_format == "1.0" then
skin_obj:set_hand_from_texture()
end
skin_obj:set_hand_from_texture()
file = io.open(skins.modpath.."/meta/"..name..".txt", "r")
if file then
local data = string.split(file:read("*all"), "\n", 3)