VoxeLibre/mods/ENTITIES/mobs_mc/4_heads.lua

63 lines
2.3 KiB
Lua
Raw Normal View History

2017-07-06 00:43:34 +02:00
--MC Heads for minetest
--maikerumine
-- NOTE: Strings intentionally not marked for translation, other mods already have these items.
-- TODO: Remove this file eventually, all items here are already outsourced in other mods.
local S = minetest.get_translator("mobs_mc")
2017-07-06 00:43:34 +02:00
-- Heads system
local sounds
if minetest.get_modpath("default") then
sounds = default.node_sound_defaults({
footstep = {name="default_hard_footstep", gain=0.3}
})
end
local function addhead(mobname, desc, longdesc)
2017-07-06 00:47:13 +02:00
if not mobs_mc.is_item_variable_overridden("head_"..mobname) then
return
end
2017-07-06 00:43:34 +02:00
minetest.register_node("mobs_mc:head_"..mobname, {
description = desc,
_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, },
},
},
groups = { oddly_breakable_by_hand=3, head=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=mobs_mc_"..mobname..".png", -- top
"([combine:16x16:-4,4=mobs_mc_"..mobname..".png)^([combine:16x16:-12,4=mobs_mc_"..mobname..".png)", -- bottom
"[combine:16x16:-12,0=mobs_mc_"..mobname..".png", -- left
"[combine:16x16:4,0=mobs_mc_"..mobname..".png", -- right
"[combine:16x16:-20,0=mobs_mc_"..mobname..".png", -- back
"[combine:16x16:-4,0=mobs_mc_"..mobname..".png", -- front
},
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = true,
sounds = sounds,
selection_box = {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
},
})
end
-- Add heads
addhead("zombie", "Zombie Head", "A zombie head is a small decorative block which resembles the head of a zombie.")
addhead("creeper", "Creeper Head", "A creeper head is a small decorative block which resembles the head of a creeper.")
addhead("skeleton", "Skeleton Skull", "A skeleton skull is a small decorative block which resembles the skull of a skeleton.")
addhead("wither_skeleton", "Wither Skeleton Skull", "A wither skeleton skull is a small decorative block which resembles the skull of a wither skeleton.")