Add comment in minecart code
[MineClone/MineClone2.git] / mods / ITEMS / mcl_heads / init.lua
blob88ba0c644d80f3ba468b4253b2ffdef1da03da8b
1 -- Heads system
3 local function addhead(name, texture, desc, longdesc)
4 local on_rotate
5 if minetest.get_modpath("screwdriver") then
6 on_rotate = screwdriver.rotate_simple
7 end
9 minetest.register_node("mcl_heads:"..name, {
10 description = desc,
11 _doc_items_longdesc = longdesc,
12 drawtype = "nodebox",
13 is_ground_content = false,
14 node_box = {
15 type = "fixed",
16 fixed = {
17 { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
20 groups = {handy=1, armor_head=1,non_combat_armor=1, head=1, deco_block=1, dig_by_piston=1},
21 -- The head textures are based off the textures of an actual mob.
22 -- FIXME: This code assumes 16×16 textures for the mob textures!
23 tiles = {
24 -- Note: bottom texture is overlaid over top texture to get rid of possible transparency.
25 -- This is required for skeleton skull and wither skeleton skull.
26 "[combine:16x16:-4,4="..texture, -- top
27 "([combine:16x16:-4,4="..texture..")^([combine:16x16:-12,4="..texture..")", -- bottom
28 "[combine:16x16:-12,0="..texture, -- left
29 "[combine:16x16:4,0="..texture, -- right
30 "[combine:16x16:-20,0="..texture, -- back
31 "[combine:16x16:-4,0="..texture, -- front
32 },
33 paramtype = "light",
34 stack_max = 64,
35 paramtype2 = "facedir",
36 sunlight_propagates = true,
37 walkable = true,
38 selection_box = {
39 type = "fixed",
40 fixed = { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
42 sounds = mcl_sounds.node_sound_defaults({
43 footstep = {name="default_hard_footstep", gain=0.3}
44 }),
45 on_rotate = on_rotate,
46 _mcl_blast_resistance = 5,
47 _mcl_hardness = 1,
49 end
51 -- Add heads
52 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.")
53 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.")
54 -- Original Minecraft name: “Head”
55 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.")
56 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.")
57 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.")