mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-29 22:11:10 +01:00
Add can_spawn callback in mob api
This commit is contained in:
parent
32ac2ffeb8
commit
94f0d679f2
2 changed files with 4 additions and 0 deletions
|
@ -4034,6 +4034,7 @@ minetest.register_entity(name, {
|
||||||
teleport = teleport,
|
teleport = teleport,
|
||||||
do_teleport = def.do_teleport,
|
do_teleport = def.do_teleport,
|
||||||
spawn_class = def.spawn_class,
|
spawn_class = def.spawn_class,
|
||||||
|
can_spawn = def.can_spawn,
|
||||||
ignores_nametag = def.ignores_nametag or false,
|
ignores_nametag = def.ignores_nametag or false,
|
||||||
rain_damage = def.rain_damage or 0,
|
rain_damage = def.rain_damage or 0,
|
||||||
glow = def.glow,
|
glow = def.glow,
|
||||||
|
|
|
@ -533,6 +533,9 @@ if mobs_spawn then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if minetest.registered_entities[mob_def.name].can_spawn and not minetest.registered_entities[mob_def.name].can_spawn(pos) then
|
||||||
|
return
|
||||||
|
end
|
||||||
--everything is correct, spawn mob
|
--everything is correct, spawn mob
|
||||||
local object
|
local object
|
||||||
if spawn_in_group then
|
if spawn_in_group then
|
||||||
|
|
Loading…
Reference in a new issue