This repository has been archived on 2023-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
MineClone2/mods/ITEMS/mcl_heads/init.lua

52 lines
2.6 KiB
Lua
Raw Normal View History

2017-01-31 10:05:32 +01:00
-- Heads system
2015-06-29 19:55:56 +02:00
local function addhead(name, texture, desc, longdesc)
minetest.register_node("mcl_heads:"..name, {
2017-01-31 10:05:32 +01:00
description = desc,
2017-03-11 18:56:01 +01:00
_doc_items_longdesc = longdesc,
drawtype = "nodebox",
is_ground_content = false,
node_box = {
type = "fixed",
fixed = {
{ -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
2015-06-29 19:55:56 +02:00
},
},
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 = {
-- Note: bottom texture is overlaid over top texture to get rid of possible transparency.
-- This is required for skeleton skull and wither skeleton skull.
"[combine:16x16:-4,4="..texture, -- top
"([combine:16x16:-4,4="..texture..")^([combine:16x16:-12,4="..texture..")", -- bottom
"[combine:16x16:-12,0="..texture, -- left
"[combine:16x16:4,0="..texture, -- right
"[combine:16x16:-20,0="..texture, -- back
"[combine:16x16:-4,0="..texture, -- front
},
paramtype = "light",
2017-02-01 23:18:09 +01:00
stack_max = 64,
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
},
sounds = mcl_sounds.node_sound_defaults({
footstep = {name="default_hard_footstep", gain=0.3}
}),
_mcl_blast_resistance = 5,
_mcl_hardness = 1,
2015-06-29 19:55:56 +02:00
})
end
2017-01-31 10:05:32 +01:00
-- Add heads
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", "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.")
2017-03-11 18:51:39 +01:00
-- Original Minecraft name: “Head”
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", "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", "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.")