Base mob heads off the mob/player textures

This commit is contained in:
Wuzzy 2017-07-06 01:13:57 +02:00
parent 684c11d79f
commit 8dbeeade01

@ -1,7 +1,7 @@
-- Heads system -- Heads system
local function addhead(node, desc, longdesc) local function addhead(name, texture, desc, longdesc)
minetest.register_node("mcl_heads:"..node, { minetest.register_node("mcl_heads:"..name, {
description = desc, description = desc,
_doc_items_longdesc = longdesc, _doc_items_longdesc = longdesc,
drawtype = "nodebox", drawtype = "nodebox",
@ -13,13 +13,17 @@ local function addhead(node, desc, longdesc)
}, },
}, },
groups = {handy=1, armor_head=1,non_combat_armor=1, head=1, deco_block=1, dig_by_piston=1}, groups = {handy=1, armor_head=1,non_combat_armor=1, head=1, deco_block=1, dig_by_piston=1},
-- The head textures are based off the textures of an actual mob.
-- FIXME: This code assumes 16×16 textures for the mob textures!
tiles = { tiles = {
"head_"..node.."_top.png", -- Note: bottom texture is overlaid over top texture to get rid of possible transparency.
"head_"..node.."_top.png", -- This is required for skeleton skull and wither skeleton skull.
"head_"..node.."_left.png", "[combine:16x16:-4,4="..texture, -- top
"head_"..node.."_right.png", "([combine:16x16:-4,4="..texture..")^([combine:16x16:-12,4="..texture..")", -- bottom
"head_"..node.."_back.png", "[combine:16x16:-12,0="..texture, -- left
"head_"..node.."_face.png", "[combine:16x16:4,0="..texture, -- right
"[combine:16x16:-20,0="..texture, -- back
"[combine:16x16:-4,0="..texture, -- front
}, },
paramtype = "light", paramtype = "light",
stack_max = 64, stack_max = 64,
@ -39,9 +43,9 @@ local function addhead(node, desc, longdesc)
end end
-- Add heads -- Add heads
addhead("zombie", "Zombie Head", "A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet for fun, but does not offer any protection.") addhead("zombie", "mobs_mc_zombie.png", "Zombie Head", "A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet for fun, but does not offer any protection.")
addhead("creeper", "Creeper Head", "A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet for fun, but does not offer any protection.") addhead("creeper", "mobs_mc_creeper.png", "Creeper Head", "A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet for fun, but does not offer any protection.")
-- Original Minecraft name: “Head” -- Original Minecraft name: “Head”
addhead("steve", "Human Head", "A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection.") addhead("steve", "character.png", "Human Head", "A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection.")
addhead("skeleton", "Skeleton Skull", "A skeleton skull is a small decorative block which resembles the head of a skeleton. It can also be worn as a helmet for fun, but does not offer any protection.") addhead("skeleton", "mobs_mc_skeleton.png", "Skeleton Skull", "A skeleton skull is a small decorative block which resembles the head of a skeleton. It can also be worn as a helmet for fun, but does not offer any protection.")
addhead("wither_skeleton", "Wither Skeleton Skull", "A wither skeleton skull is a small decorative block which resembles the head of a wither skeleton. It can also be worn as a helmet for fun, but does not offer any protection.") addhead("wither_skeleton", "mobs_mc_wither_skeleton.png", "Wither Skeleton Skull", "A wither skeleton skull is a small decorative block which resembles the head of a wither skeleton. It can also be worn as a helmet for fun, but does not offer any protection.")