mobs:add_mob() can now set mob texture
* backported upstream commit ce47b81da56bba7618f1ab62ede0daaca1b88ced
This commit is contained in:
parent
359ad19bf2
commit
1cd4884707
11
api.lua
11
api.lua
@ -4011,8 +4011,13 @@ function mobs:add_mob(pos, def)
|
|||||||
effect(pos, 15, "tnt_smoke.png", 1, 2, 2, 15, 5)
|
effect(pos, 15, "tnt_smoke.png", 1, 2, 2, 15, 5)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- use new texture if found
|
||||||
|
local new_texture = def.texture or ent.base_texture
|
||||||
|
|
||||||
if def.child then
|
if def.child then
|
||||||
|
|
||||||
|
ent.mommy_tex = new_texture -- how baby looks when grown
|
||||||
|
ent.base_texture = new_texture
|
||||||
local textures = ent.base_texture
|
local textures = ent.base_texture
|
||||||
|
|
||||||
-- using specific child texture (if found)
|
-- using specific child texture (if found)
|
||||||
@ -4046,6 +4051,12 @@ function mobs:add_mob(pos, def)
|
|||||||
})
|
})
|
||||||
|
|
||||||
ent.child = true
|
ent.child = true
|
||||||
|
-- if not child set new texture
|
||||||
|
elseif def.texture then
|
||||||
|
|
||||||
|
ent.base_texture = new_texture
|
||||||
|
|
||||||
|
mob:set_properties({textures = new_texture})
|
||||||
end
|
end
|
||||||
|
|
||||||
if def.owner then
|
if def.owner then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user