Add mesh hand
This commit is contained in:
parent
62eaf60938
commit
9a54383a23
8 changed files with 76 additions and 3 deletions
9
mods/PLAYER/mcl_meshhand/README.md
Normal file
9
mods/PLAYER/mcl_meshhand/README.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
Mesh hand mod for MineClone 2.
|
||||
|
||||
This mod uses a better-looking mesh for the wieldhand and applies the player skin texture to it.
|
||||
|
||||
== Credits ==
|
||||
Based on 3D Hand [newhand] mod by jordan4ibanez.
|
||||
https://forum.minetest.net/viewtopic.php?t=16435
|
||||
|
||||
License: CC0
|
1
mods/PLAYER/mcl_meshhand/depends.txt
Normal file
1
mods/PLAYER/mcl_meshhand/depends.txt
Normal file
|
@ -0,0 +1 @@
|
|||
mcl_skins?
|
1
mods/PLAYER/mcl_meshhand/description.txt
Normal file
1
mods/PLAYER/mcl_meshhand/description.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Applies the player skin texture to the hand.
|
47
mods/PLAYER/mcl_meshhand/init.lua
Normal file
47
mods/PLAYER/mcl_meshhand/init.lua
Normal file
|
@ -0,0 +1,47 @@
|
|||
local has_mcl_skins = minetest.get_modpath("mcl_skins") ~= nil
|
||||
|
||||
-- mcl_skins is enabled
|
||||
if has_mcl_skins == true then
|
||||
--generate a node for every skin
|
||||
for _,texture in pairs(mcl_skins.list) do
|
||||
minetest.register_node("mcl_meshhand:"..texture, {
|
||||
description = "",
|
||||
tiles = {texture..".png"},
|
||||
inventory_image = "blank.png",
|
||||
visual_scale = 1,
|
||||
wield_scale = {x=1,y=1,z=1},
|
||||
paramtype = "light",
|
||||
drawtype = "mesh",
|
||||
mesh = "mcl_meshhand.b3d",
|
||||
node_placement_prediction = "",
|
||||
})
|
||||
end
|
||||
--change the player's hand to their skin
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local skin = mcl_skins.skins[player:get_player_name()]
|
||||
player:get_inventory():set_stack("hand", 1, "mcl_meshhand:"..skin)
|
||||
end)
|
||||
|
||||
mcl_skins.register_on_set_skin(function(player, skin)
|
||||
local name = player:get_player_name()
|
||||
player:get_inventory():set_stack("hand", 1, "mcl_meshhand:"..skin)
|
||||
end)
|
||||
|
||||
--do default skin if no skin mod installed
|
||||
else
|
||||
minetest.register_node("mcl_meshhand:hand", {
|
||||
description = "",
|
||||
tiles = {"character.png"},
|
||||
inventory_image = "blank.png",
|
||||
visual_scale = 1,
|
||||
wield_scale = {x=1,y=1,z=1},
|
||||
paramtype = "light",
|
||||
drawtype = "mesh",
|
||||
mesh = "mcl_meshhand.b3d",
|
||||
node_placement_prediction = "",
|
||||
})
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
player:get_inventory():set_stack("hand", 1, "mcl_meshhand:hand")
|
||||
end)
|
||||
end
|
1
mods/PLAYER/mcl_meshhand/mod.conf
Normal file
1
mods/PLAYER/mcl_meshhand/mod.conf
Normal file
|
@ -0,0 +1 @@
|
|||
name = mcl_meshhand
|
BIN
mods/PLAYER/mcl_meshhand/models/mcl_meshhand.b3d
Normal file
BIN
mods/PLAYER/mcl_meshhand/models/mcl_meshhand.b3d
Normal file
Binary file not shown.
BIN
mods/PLAYER/mcl_meshhand/models/mcl_meshhand.blend
Normal file
BIN
mods/PLAYER/mcl_meshhand/models/mcl_meshhand.blend
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue