do not regiter mobs if there is not a mob
* backported from undocumented upstream commit 812f18430c343c9ac70b83276faa3aabf5a25116
This commit is contained in:
parent
d0938ff178
commit
81066c8b92
10
api.lua
10
api.lua
@ -4518,6 +4518,16 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
|
|||||||
"^[mask:mobs_chicken_egg_overlay.png)"
|
"^[mask:mobs_chicken_egg_overlay.png)"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- does mob/entity exist
|
||||||
|
local is_mob = minetest.registered_entities[mob]
|
||||||
|
|
||||||
|
if not is_mob then
|
||||||
|
print("[Mobs Redo] Spawn Egg cannot be created for " .. mob)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- these are only created for animals and npc mobs, not monsters TODO
|
||||||
|
-- if is_mob.type ~= "monster" then return end
|
||||||
|
|
||||||
-- register new spawn egg containing mob information (cannot be stacked)
|
-- register new spawn egg containing mob information (cannot be stacked)
|
||||||
minetest.register_craftitem(mob .. "_set", {
|
minetest.register_craftitem(mob .. "_set", {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user