From b1c97a05107442d9be995005c677992546f7ba38 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 4 Jul 2022 01:41:45 +0200 Subject: [PATCH 1/3] prevent ground squids, variable spawn height --- mods/ENTITIES/mcl_mobs/spawning.lua | 3 ++- mods/ENTITIES/mobs_mc/squid.lua | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 8fa2e7a8a..faad27537 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -453,11 +453,12 @@ if mobs_spawn then and (mob_def.check_position and mob_def.check_position(spawning_position) or true) and (not is_farm_animal(mob_def.name) or is_grass) and (mob_type ~= "npc" or has_bed) + and (mob_def.type_of_spawning ~= water or is_water) then --everything is correct, spawn mob local object = minetest.add_entity(spawning_position, mob_def.name) if object then - return mob_def.on_spawn and mob_def.on_spawn(object, pos) + return mob_def.on_spawn and mob_def.on_spawn(object, spawning_position) end end current_summary_chance = current_summary_chance - mob_chance diff --git a/mods/ENTITIES/mobs_mc/squid.lua b/mods/ENTITIES/mobs_mc/squid.lua index 86b80976e..f4ca0521a 100644 --- a/mods/ENTITIES/mobs_mc/squid.lua +++ b/mods/ENTITIES/mobs_mc/squid.lua @@ -55,6 +55,17 @@ mcl_mobs:register_mob("mobs_mc:squid", { view_range = 16, runaway = true, fear_height = 4, + on_spawn = function(self) + --make sure squids always spawn in water (and at variable heights) + --can be removed once this is provided by the api + local p = self.object:get_pos() + local nn = minetest.find_nodes_in_area(vector.offset(p,-2,-1,-2),vector.offset(p,2,-15,2),{"group:water"}) + if nn and #nn > 0 then + self.object:set_pos(nn[math.random(#nn)]) + else + self.object:remove() + end + end, }) -- TODO: Behaviour: squirt From bc2e61921f1b5f489fffbbf251328a9003093013 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 4 Jul 2022 01:46:41 +0200 Subject: [PATCH 2/3] do not spawn polar bears in extremehills+_snowtop --- mods/ENTITIES/mobs_mc/polar_bear.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/polar_bear.lua b/mods/ENTITIES/mobs_mc/polar_bear.lua index 3fd2d0a0c..4b2f338b2 100644 --- a/mods/ENTITIES/mobs_mc/polar_bear.lua +++ b/mods/ENTITIES/mobs_mc/polar_bear.lua @@ -76,7 +76,6 @@ mcl_mobs:spawn_specific( "ColdTaiga", "IcePlainsSpikes", "IcePlains", -"ExtremeHills+_snowtop", }, 0, minetest.LIGHT_MAX+1, From 0e6250b2a367817d35a694a56acced2392a45ad3 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 4 Jul 2022 12:50:48 +0200 Subject: [PATCH 3/3] Fix rabbit spawning biomes --- mods/ENTITIES/mobs_mc/rabbit.lua | 9 --------- 1 file changed, 9 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua index 524000a71..2632eafce 100644 --- a/mods/ENTITIES/mobs_mc/rabbit.lua +++ b/mods/ENTITIES/mobs_mc/rabbit.lua @@ -132,18 +132,9 @@ mcl_mobs:spawn_specific( "Desert", "FlowerForest", "Taiga", -"ExtremeHills", -"BirchForest", "MegaSpruceTaiga", "MegaTaiga", -"ExtremeHills+", -"Plains", "ColdTaiga", -"SunflowerPlains", -"RoofedForest", -"MesaPlateauFM_grasstop", -"ExtremeHillsM", -"BirchForestM", }, 9, minetest.LIGHT_MAX+1,