1
0
Fork 0

Fix weird-looking cactus when held by enderman

This commit is contained in:
Wuzzy 2017-08-23 04:34:06 +02:00
parent 6d84a139d6
commit e2b57327fe
5 changed files with 42 additions and 7 deletions

View File

@ -241,6 +241,13 @@ mobs_mc.enderman_takable = {
"nether:rack", "nether:rack",
} }
-- A table which can be used to override block textures of blocks carried by endermen.
-- Only works for cube-shaped nodes and nodeboxes.
-- Key: itemstrings of the blocks to replace
-- Value: A table with the texture overrides (6 textures)
mobs_mc.enderman_block_texture_overrides = {
}
-- List of nodes on which mobs can spawn -- List of nodes on which mobs can spawn
mobs_mc.spawn = { mobs_mc.spawn = {
solid = { "group:cracky", "group:crumbly", "group:shovely", "group:pickaxey" }, -- spawn on "solid" nodes (this is mostly just guessing) solid = { "group:cracky", "group:crumbly", "group:shovely", "group:pickaxey" }, -- spawn on "solid" nodes (this is mostly just guessing)
@ -300,5 +307,8 @@ if minetest.get_modpath("mobs_mc_gameconfig") and mobs_mc.override then
if mobs_mc.override.enderman_takable then if mobs_mc.override.enderman_takable then
mobs_mc.enderman_takable = mobs_mc.override.enderman_takable mobs_mc.enderman_takable = mobs_mc.override.enderman_takable
end end
if mobs_mc.enderman_block_texture_overrides then
mobs_mc.enderman_block_texture_overrides = mobs_mc.override.enderman_block_texture_overrides
end
end end

View File

@ -39,6 +39,11 @@ local create_enderman_textures = function(block_type, itemstring)
local tiles = minetest.registered_nodes[itemstring].tiles local tiles = minetest.registered_nodes[itemstring].tiles
local textures = {} local textures = {}
local last local last
if mobs_mc.enderman_block_texture_overrides[itemstring] then
-- Texture override available? Use these instead!
textures = mobs_mc.enderman_block_texture_overrides[itemstring]
else
-- Extract the texture names
for i = 1, 6 do for i = 1, 6 do
if type(tiles[i]) == "string" then if type(tiles[i]) == "string" then
last = tiles[i] last = tiles[i]
@ -49,6 +54,7 @@ local create_enderman_textures = function(block_type, itemstring)
end end
table.insert(textures, last) table.insert(textures, last)
end end
end
return { return {
"blank.png", "blank.png",
"blank.png", "blank.png",

View File

@ -1 +1,2 @@
mcl_init mcl_init
mcl_core

View File

@ -169,6 +169,24 @@ mobs_mc.override.enderman_takable = {
"group:enderman_takable", "group:enderman_takable",
} }
-- Texuture overrides for enderman block. Required for cactus because it's original is a nodebox
-- and the textures have tranparent pixels.
local cbackground = "mobs_mc_gameconfig_enderman_cactus_background.png"
local ctiles = minetest.registered_nodes["mcl_core:cactus"].tiles
local ctable = {}
local last
for i=1, 6 do
if ctiles[i] then
last = ctiles[i]
end
table.insert(ctable, cbackground .. "^" .. last)
end
mobs_mc.override.enderman_block_texture_overrides = {
["mcl_core:cactus"] = ctable,
}
-- List of nodes on which mobs can spawn -- List of nodes on which mobs can spawn
mobs_mc.override.spawn = { mobs_mc.override.spawn = {
solid = { "group:solid", }, -- spawn on "solid" nodes solid = { "group:solid", }, -- spawn on "solid" nodes

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B