Completely redefine mob heads

* Remove unused mob heads
* Remove special head textures
* Base head tiles off the mob texture
* Simplify head code
This commit is contained in:
Wuzzy 2017-07-05 15:46:45 +02:00
parent 7bc13c82b8
commit 2a88e66889
26 changed files with 48 additions and 199 deletions

View File

@ -4,7 +4,6 @@
The following media licenses are used: The following media licenses are used:
* **Unknown license :-(**
* [CC0](https://creativecommons.org/choose/zero/) * [CC0](https://creativecommons.org/choose/zero/)
* [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/) * [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
* [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) * [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)
@ -28,7 +27,6 @@ Origin of those models:
* Author: [XSSheep](https://www.planetminecraft.com/member/xssheep/) * Author: [XSSheep](https://www.planetminecraft.com/member/xssheep/)
* License: CC BY-SA 4.0 * License: CC BY-SA 4.0
* “Spawn egg” textures (`mobs_mc_spawn_icon_*`) by 22i * “Spawn egg” textures (`mobs_mc_spawn_icon_*`) by 22i
* Mob head textures: **UNKNOWN!**
* Any other texture not mentioned here are licensed under the MIT License * Any other texture not mentioned here are licensed under the MIT License
## Sounds ## Sounds

View File

@ -14,7 +14,7 @@ This mod adds mobs which closely resemble the mobs from the game Minecraft, vers
## Licensing ## Licensing
* Code: GNU General Public License, version 3 (see `LICENSE`) * Code: GNU General Public License, version 3 (see `LICENSE`)
* Media: **WARNING!** Possibly includes non-free license (we will replace it soon). See `LICENSE_media.md` * Media: MIT, CC0, CC BY 3.0 CC BY-SA 4.0, LGPLv2.1, GPLv3. See `LICENSE_media.md` for details
## Useful information for developers ## Useful information for developers

225
heads.lua
View File

@ -5,203 +5,54 @@
local MP = minetest.get_modpath(minetest.get_current_modname()) local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua") local S, NS = dofile(MP.."/intllib.lua")
minetest.register_node( "mobs_mc:creeper_head", { -- Heads system
description = S("Creeper Head (WIP)"),
tiles = {
"mobs_creeper_top.png",
"mobs_creeper_top.png", --was bottom
"mobs_creeper_side.png",
"mobs_creeper_side.png",
"mobs_creeper_side.png", --was rear
"mobs_creeper_front.png"
},
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25},
},
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)
minetest.register_node("mobs_mc:head_"..mobname, {
description = desc,
_doc_items_longdesc = longdesc,
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light",
visual_scale = 1.0,
is_ground_content = false, is_ground_content = false,
groups = {cracky=2},
--sounds = default.node_sound_stone_defaults(),
stack_max = 1,
})
minetest.register_node( "mobs_mc:enderman_head", {
description = S("Enderman Head (WIP)"),
tiles = {
"mobs_endermen_top.png",
"mobs_endermen_top.png",
"mobs_endermen_side.png",
"mobs_endermen_side.png",
"mobs_endermen_side.png",
"mobs_endermen_front.png"
},
paramtype2 = "facedir",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25}, fixed = {
{ -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
}, },
},
drawtype = "nodebox", groups = { oddly_breakable_by_hand=3, armor_head=1, head=1, },
paramtype = "light", -- The head textures are based off the textures of an actual mob.
visual_scale = 1.0, -- FIXME: This code assumes 16×16 textures for the mob textures!
is_ground_content = true,
groups = {cracky=2},
--sounds = default.node_sound_stone_defaults(),
stack_max = 1,
})
minetest.register_node( "mobs_mc:ghast_head", {
description = S("Ghast Head (WIP)"),
tiles = { tiles = {
"mobs_mc_ghast_white.png", -- Note: bottom texture is overlaid over top texture to get rid of possible transparency.
"mobs_mc_ghast_white.png", -- This is required for skeleton skull and wither skeleton skull.
"mobs_mc_ghast_white.png", "[combine:16x16:-4,4=mobs_mc_"..mobname..".png", -- top
"mobs_mc_ghast_white.png", "([combine:16x16:-4,4=mobs_mc_"..mobname..".png)^([combine:16x16:-12,4=mobs_mc_"..mobname..".png)", -- bottom
"mobs_mc_ghast_white.png", "[combine:16x16:-12,0=mobs_mc_"..mobname..".png", -- left
"mobs_mc_ghast_front.png" "[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
}, },
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25},
},
drawtype = "nodebox",
paramtype = "light", paramtype = "light",
visual_scale = 1.0,
is_ground_content = true,
groups = {cracky=2},
--sounds = default.node_sound_stone_defaults(),
stack_max = 1,
})
minetest.register_node( "mobs_mc:skeleton_head", {
description = S("Skeleton Skull (WIP)"),
tiles = {
"mobs_skeleton_top.png",
"mobs_skeleton_top.png",
"mobs_skeleton_side.png",
"mobs_skeleton_side.png",
"mobs_skeleton_side.png",
"mobs_skeleton_front.png"
},
paramtype2 = "facedir", paramtype2 = "facedir",
node_box = { sunlight_propagates = true,
walkable = true,
sounds = sounds,
selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25}, fixed = { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
}, },
})
end
drawtype = "nodebox", -- Add heads
paramtype = "light", addhead("zombie", S("Zombie Head"), S("A zombie head is a small decorative block which resembles the head of a zombie."))
visual_scale = 1.0, addhead("creeper", S("Creeper Head"), S("A creeper head is a small decorative block which resembles the head of a creeper."))
is_ground_content = false, addhead("skeleton", S("Skeleton Skull"), S("A skeleton skull is a small decorative block which resembles the head of a skeleton."))
groups = {cracky=2}, addhead("wither_skeleton", S("Wither Skeleton Skull"), S("A wither skeleton skull is a small decorative block which resembles the head of a wither skeleton."))
--sounds = default.node_sound_stone_defaults(),
stack_max = 1,
})
minetest.register_node( "mobs_mc:skeleton2_head", {
description = S("Wither Skeleton Skull (WIP)"),
tiles = {
"mobs_skeleton2_top.png",
"mobs_skeleton2_top.png",
"mobs_skeleton2_side.png",
"mobs_skeleton2_side.png",
"mobs_skeleton2_side.png",
"mobs_skeleton2_front.png"
},
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25},
},
drawtype = "nodebox",
paramtype = "light",
visual_scale = 1.0,
is_ground_content = true,
groups = {cracky=2},
--sounds = default.node_sound_stone_defaults(),
stack_max = 1,
})
minetest.register_node( "mobs_mc:spider_head", {
description = S("Spider Head (WIP)"),
tiles = {
"mobs_spider_top.png",
"mobs_spider_top.png",
"mobs_spider_side.png",
"mobs_spider_side.png",
"mobs_spider_side.png",
"mobs_spider_front.png"
},
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25},
},
drawtype = "nodebox",
paramtype = "light",
visual_scale = 1.0,
is_ground_content = true,
groups = {cracky=2},
--sounds = default.node_sound_stone_defaults(),
stack_max = 1,
})
minetest.register_node( "mobs_mc:zombie_head", {
description = S("Zombie Head (WIP)"),
tiles = {
"mobs_zombie_top.png",
"mobs_zombie_top.png",
"mobs_zombie_side.png",
"mobs_zombie_side.png",
"mobs_zombie_side.png",
"mobs_zombie_front.png"
},
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25},
},
drawtype = "nodebox",
paramtype = "light",
visual_scale = 1.0,
is_ground_content = true,
groups = {cracky=2},
--sounds = default.node_sound_stone_defaults(),
stack_max = 1,
})
minetest.register_node( "mobs_mc:zombiepig_head", {
description = S("Zombie Pigman Head (WIP)"),
tiles = {
"mobs_zombiepig_top.png",
"mobs_zombiepig_top.png",
"mobs_zombiepig_side.png",
"mobs_zombiepig_side.png",
"mobs_zombiepig_side.png",
"mobs_zombiepig_front.png"
},
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25},
},
drawtype = "nodebox",
paramtype = "light",
visual_scale = 1.0,
is_ground_content = true,
groups = {cracky=2},
--sounds = default.node_sound_stone_defaults(),
stack_max = 1,
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB