forked from VoxeLibre/VoxeLibre
Fix mob api can_spawn callback
This commit is contained in:
parent
ae9173f7ec
commit
646a341f52
|
@ -672,8 +672,8 @@ 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
|
if minetest.registered_entities[mob_def.name].can_spawn and not minetest.registered_entities[mob_def.name].can_spawn(spawning_position) then
|
||||||
minetest.log("warning","[mcl_mobs] mob "..mob_def.name.." refused to spawn at "..minetest.pos_to_string(vector.round(pos)))
|
minetest.log("warning","[mcl_mobs] mob "..mob_def.name.." refused to spawn at "..minetest.pos_to_string(vector.round(spawning_position)))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
--everything is correct, spawn mob
|
--everything is correct, spawn mob
|
||||||
|
|
|
@ -60,6 +60,10 @@ local strider = {
|
||||||
fire_resistant = true,
|
fire_resistant = true,
|
||||||
floats_on_lava = 1,
|
floats_on_lava = 1,
|
||||||
floats = 0,
|
floats = 0,
|
||||||
|
can_spawn = function(pos)
|
||||||
|
local l = minetest.find_node_near(pos,2,{"mcl_nether:nether_lava_source","mcl_nether:nether_lava_flowing"})
|
||||||
|
return l ~= nil
|
||||||
|
end,
|
||||||
do_custom = function(self, dtime)
|
do_custom = function(self, dtime)
|
||||||
|
|
||||||
if minetest.find_node_near(self.object:get_pos(), 2, {"mcl_core:lava_source","mcl_core:lava_flowing","mcl_nether:nether_lava_source","mcl_nether:nether_lava_flowing"}) then
|
if minetest.find_node_near(self.object:get_pos(), 2, {"mcl_core:lava_source","mcl_core:lava_flowing","mcl_nether:nether_lava_source","mcl_nether:nether_lava_flowing"}) then
|
||||||
|
|
Loading…
Reference in New Issue