Version 0.42.1
[MineClone/MineClone2.git] / mods / ENTITIES / mobs_mc / 4_heads.lua
blob80c9719881a0dad600699829170404aaf79df7cb
1 --MC Heads for minetest
2 --maikerumine
4 -- intllib
5 local MP = minetest.get_modpath(minetest.get_current_modname())
6 local S, NS = dofile(MP.."/intllib.lua")
8 -- Heads system
10 local sounds
11 if minetest.get_modpath("default") then
12 sounds = default.node_sound_defaults({
13 footstep = {name="default_hard_footstep", gain=0.3}
15 end
17 local function addhead(mobname, desc, longdesc)
18 if not mobs_mc.is_item_variable_overridden("head_"..mobname) then
19 return
20 end
21 minetest.register_node("mobs_mc:head_"..mobname, {
22 description = desc,
23 _doc_items_longdesc = longdesc,
24 drawtype = "nodebox",
25 is_ground_content = false,
26 node_box = {
27 type = "fixed",
28 fixed = {
29 { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
32 groups = { oddly_breakable_by_hand=3, head=1, },
33 -- The head textures are based off the textures of an actual mob.
34 -- FIXME: This code assumes 16×16 textures for the mob textures!
35 tiles = {
36 -- Note: bottom texture is overlaid over top texture to get rid of possible transparency.
37 -- This is required for skeleton skull and wither skeleton skull.
38 "[combine:16x16:-4,4=mobs_mc_"..mobname..".png", -- top
39 "([combine:16x16:-4,4=mobs_mc_"..mobname..".png)^([combine:16x16:-12,4=mobs_mc_"..mobname..".png)", -- bottom
40 "[combine:16x16:-12,0=mobs_mc_"..mobname..".png", -- left
41 "[combine:16x16:4,0=mobs_mc_"..mobname..".png", -- right
42 "[combine:16x16:-20,0=mobs_mc_"..mobname..".png", -- back
43 "[combine:16x16:-4,0=mobs_mc_"..mobname..".png", -- front
45 paramtype = "light",
46 paramtype2 = "facedir",
47 sunlight_propagates = true,
48 walkable = true,
49 sounds = sounds,
50 selection_box = {
51 type = "fixed",
52 fixed = { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
55 end
57 -- Add heads
58 addhead("zombie", S("Zombie Head"), S("A zombie head is a small decorative block which resembles the head of a zombie."))
59 addhead("creeper", S("Creeper Head"), S("A creeper head is a small decorative block which resembles the head of a creeper."))
60 addhead("skeleton", S("Skeleton Skull"), S("A skeleton skull is a small decorative block which resembles the skull of a skeleton."))
61 addhead("wither_skeleton", S("Wither Skeleton Skull"), S("A wither skeleton skull is a small decorative block which resembles the skull of a wither skeleton."))