From 646a341f5234b103c5874f6fb395dfd73cdf9cca Mon Sep 17 00:00:00 2001 From: cora Date: Wed, 2 Nov 2022 03:47:23 +0100 Subject: [PATCH] Fix mob api can_spawn callback --- mods/ENTITIES/mcl_mobs/spawning.lua | 4 ++-- mods/ENTITIES/mobs_mc/strider.lua | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 9bc7a6780..d7e3deb2b 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -672,8 +672,8 @@ if mobs_spawn then return end end - if minetest.registered_entities[mob_def.name].can_spawn and not minetest.registered_entities[mob_def.name].can_spawn(pos) then - minetest.log("warning","[mcl_mobs] mob "..mob_def.name.." refused to spawn at "..minetest.pos_to_string(vector.round(pos))) + 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(spawning_position))) return end --everything is correct, spawn mob diff --git a/mods/ENTITIES/mobs_mc/strider.lua b/mods/ENTITIES/mobs_mc/strider.lua index 65837d422..8344f48da 100644 --- a/mods/ENTITIES/mobs_mc/strider.lua +++ b/mods/ENTITIES/mobs_mc/strider.lua @@ -60,6 +60,10 @@ local strider = { fire_resistant = true, floats_on_lava = 1, 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) 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