diff --git a/API.md b/API.md index 830b30e..3cfe77c 100644 --- a/API.md +++ b/API.md @@ -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() diff --git a/models/skinsdb_hand_18.b3d b/models/skinsdb_hand_18.b3d new file mode 100644 index 0000000..88449c6 Binary files /dev/null and b/models/skinsdb_hand_18.b3d differ diff --git a/models/skinsdb_hand_18.blend b/models/skinsdb_hand_18.blend new file mode 100644 index 0000000..decc873 Binary files /dev/null and b/models/skinsdb_hand_18.blend differ diff --git a/skin_meta_api.lua b/skin_meta_api.lua index cdeeb8f..6c6138d 100644 --- a/skin_meta_api.lua +++ b/skin_meta_api.lua @@ -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) diff --git a/skinlist.lua b/skinlist.lua index 0c7c8ad..bde0ae5 100644 --- a/skinlist.lua +++ b/skinlist.lua @@ -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)