From b7a2fba1ce9568d1ba6e54f9617d2cb627a088f2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 5 Feb 2019 17:43:18 +0100 Subject: [PATCH] Fix spawn ABM check that prevented squid spawn --- mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua b/mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua index 35a3c34494..303feb1ad5 100644 --- a/mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua +++ b/mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua @@ -1,10 +1,11 @@ function mobs:spawn_abm_check(pos, node, name) - if (node.name == "air") then + -- Don't spawn monsters on mycelium + if (node.name == "mcl_core:mycelium" or node.name == "mcl_core:mycelium_snow") and minetest.registered_entities[name].type == "monster" then return true - elseif (node.name == "mcl_core:mycelium" or node.name == "mcl_core:mycelium_snow") and minetest.registered_entities[name].type == "monster" then - return false - elseif minetest.get_item_group(node.name, "opaque") ~= 0 then + -- Spawn on opaque or liquid nodes + elseif minetest.get_item_group(node.name, "opaque") ~= 0 or minetest.registered_nodes[node.name].liquidtype ~= "none" then return false end + -- Reject everything else return true end