Merge pull request 'Fix passive mobs not spawning in certain biomes ( #2069 )' (#2085) from fix-mobs-spawning into master

Reviewed-on: MineClone2/MineClone2#2085
This commit is contained in:
cora 2022-03-24 16:00:24 +00:00
commit 1dde51dd0b
7 changed files with 206 additions and 90 deletions

View File

@ -570,12 +570,22 @@ if mobs_spawn then
break break
end end
local gotten_node = get_node(spawning_position).name local gotten_node = get_node(spawning_position)
local gotten_node_name = gotten_node.name
local gotten_node_def = minetest.registered_nodes[gotten_node_name]
if not gotten_node or gotten_node == "air" then --skip air nodes if not gotten_node_name or not gotten_node_def or gotten_node_name == "air" then --skip air nodes
break break
end end
if gotten_node_def.use_texture_alpha and gotten_node_def.use_texture_alpha ~= "opaque" then
break
end --don't spawn on nonopaque nodes
local leaf = minetest.get_item_group(gotten_node_name,"leaves")
if leaf ~= 0 then
break end --don't spawn on treetops
local gotten_biome = minetest.get_biome_data(spawning_position) local gotten_biome = minetest.get_biome_data(spawning_position)
if not gotten_biome then if not gotten_biome then
@ -616,8 +626,8 @@ if mobs_spawn then
break break
end end
local is_water = get_item_group(gotten_node, "water") ~= 0 local is_water = get_item_group(gotten_node_name, "water") ~= 0
local is_lava = get_item_group(gotten_node, "lava") ~= 0 local is_lava = get_item_group(gotten_node_name, "lava") ~= 0
if mob_def.type_of_spawning == "ground" and is_water then if mob_def.type_of_spawning == "ground" and is_water then
break break

View File

@ -106,22 +106,42 @@ mobs:spawn_specific(
"overworld", "overworld",
"ground", "ground",
{ {
"FlowerForest", "flat",
"Swampland", "IcePlainsSpikes",
"Taiga", "ColdTaiga",
"ExtremeHills", "ColdTaiga_beach",
"BirchForest", "ColdTaiga_beach_water",
"MegaSpruceTaiga", "MegaTaiga",
"MegaTaiga", "MegaSpruceTaiga",
"ExtremeHills+", "ExtremeHills",
"Forest", "ExtremeHills_beach",
"Plains", "ExtremeHillsM",
"ColdTaiga", "ExtremeHills+",
"SunflowerPlains", "ExtremeHills+_snowtop",
"RoofedForest", "StoneBeach",
"MesaPlateauFM_grasstop", "Plains",
"ExtremeHillsM", "Plains_beach",
"BirchForestM", "SunflowerPlains",
"Taiga",
"Taiga_beach",
"Forest",
"Forest_beach",
"FlowerForest",
"FlowerForest_beach",
"BirchForest",
"BirchForestM",
"RoofedForest",
"Savanna",
"Savanna_beach",
"SavannaM",
"Jungle",
"Jungle_shore",
"JungleM",
"JungleM_shore",
"JungleEdge",
"JungleEdgeM",
"Swampland",
"Swampland_shore"
}, },
9, 9,
minetest.LIGHT_MAX+1, minetest.LIGHT_MAX+1,

View File

@ -151,22 +151,42 @@ mobs:spawn_specific(
"overworld", "overworld",
"ground", "ground",
{ {
"FlowerForest", "flat",
"Swampland", "IcePlainsSpikes",
"Taiga", "ColdTaiga",
"ExtremeHills", "ColdTaiga_beach",
"BirchForest", "ColdTaiga_beach_water",
"MegaSpruceTaiga", "MegaTaiga",
"MegaTaiga", "MegaSpruceTaiga",
"ExtremeHills+", "ExtremeHills",
"Forest", "ExtremeHills_beach",
"Plains", "ExtremeHillsM",
"ColdTaiga", "ExtremeHills+",
"SunflowerPlains", "ExtremeHills+_snowtop",
"RoofedForest", "StoneBeach",
"MesaPlateauFM_grasstop", "Plains",
"ExtremeHillsM", "Plains_beach",
"BirchForestM", "SunflowerPlains",
"Taiga",
"Taiga_beach",
"Forest",
"Forest_beach",
"FlowerForest",
"FlowerForest_beach",
"BirchForest",
"BirchForestM",
"RoofedForest",
"Savanna",
"Savanna_beach",
"SavannaM",
"Jungle",
"Jungle_shore",
"JungleM",
"JungleM_shore",
"JungleEdge",
"JungleEdgeM",
"Swampland",
"Swampland_shore"
}, },
9, 9,
minetest.LIGHT_MAX+1, minetest.LIGHT_MAX+1,

View File

@ -520,22 +520,42 @@ mobs:spawn_specific(
"overworld", "overworld",
"ground", "ground",
{ {
"FlowerForest", "flat",
"Swampland", "IcePlainsSpikes",
"Taiga", "ColdTaiga",
"ExtremeHills", "ColdTaiga_beach",
"BirchForest", "ColdTaiga_beach_water",
"MegaSpruceTaiga", "MegaTaiga",
"MegaTaiga", "MegaSpruceTaiga",
"ExtremeHills+", "ExtremeHills",
"Forest", "ExtremeHills_beach",
"Plains", "ExtremeHillsM",
"ColdTaiga", "ExtremeHills+",
"SunflowerPlains", "ExtremeHills+_snowtop",
"RoofedForest", "StoneBeach",
"MesaPlateauFM_grasstop", "Plains",
"ExtremeHillsM", "Plains_beach",
"BirchForestM", "SunflowerPlains",
"Taiga",
"Taiga_beach",
"Forest",
"Forest_beach",
"FlowerForest",
"FlowerForest_beach",
"BirchForest",
"BirchForestM",
"RoofedForest",
"Savanna",
"Savanna_beach",
"SavannaM",
"Jungle",
"Jungle_shore",
"JungleM",
"JungleM_shore",
"JungleEdge",
"JungleEdgeM",
"Swampland",
"Swampland_shore"
}, },
0, 0,
minetest.LIGHT_MAX+1, minetest.LIGHT_MAX+1,

View File

@ -223,12 +223,18 @@ mobs:spawn_specific(
"overworld", "overworld",
"ground", "ground",
{ {
"Mesa", "Mesa",
"MesaPlateauFM_grasstop", "MesaPlateauFM_grasstop",
"MesaPlateauF", "MesaPlateauF",
"MesaPlateauFM", "MesaPlateauFM",
"MesaPlateauF_grasstop", "MesaPlateauF_grasstop",
"MesaBryce", "MesaBryce",
"Jungle",
"Jungle_shore",
"JungleM",
"JungleM_shore",
"JungleEdge",
"JungleEdgeM",
}, },
0, 0,
minetest.LIGHT_MAX+1, minetest.LIGHT_MAX+1,

View File

@ -188,22 +188,42 @@ mobs:spawn_specific(
"overworld", "overworld",
"ground", "ground",
{ {
"FlowerForest", "flat",
"Swampland", "IcePlainsSpikes",
"Taiga", "ColdTaiga",
"ExtremeHills", "ColdTaiga_beach",
"BirchForest", "ColdTaiga_beach_water",
"MegaSpruceTaiga", "MegaTaiga",
"MegaTaiga", "MegaSpruceTaiga",
"ExtremeHills+", "ExtremeHills",
"Forest", "ExtremeHills_beach",
"Plains", "ExtremeHillsM",
"ColdTaiga", "ExtremeHills+",
"SunflowerPlains", "ExtremeHills+_snowtop",
"RoofedForest", "StoneBeach",
"MesaPlateauFM_grasstop", "Plains",
"ExtremeHillsM", "Plains_beach",
"BirchForestM", "SunflowerPlains",
"Taiga",
"Taiga_beach",
"Forest",
"Forest_beach",
"FlowerForest",
"FlowerForest_beach",
"BirchForest",
"BirchForestM",
"RoofedForest",
"Savanna",
"Savanna_beach",
"SavannaM",
"Jungle",
"Jungle_shore",
"JungleM",
"JungleM_shore",
"JungleEdge",
"JungleEdgeM",
"Swampland",
"Swampland_shore"
}, },
9, 9,
minetest.LIGHT_MAX+1, minetest.LIGHT_MAX+1,

View File

@ -309,22 +309,42 @@ mobs:spawn_specific(
"overworld", "overworld",
"ground", "ground",
{ {
"FlowerForest", "flat",
"Swampland", "IcePlainsSpikes",
"Taiga", "ColdTaiga",
"ExtremeHills", "ColdTaiga_beach",
"BirchForest", "ColdTaiga_beach_water",
"MegaSpruceTaiga", "MegaTaiga",
"MegaTaiga", "MegaSpruceTaiga",
"ExtremeHills+", "ExtremeHills",
"Forest", "ExtremeHills_beach",
"Plains", "ExtremeHillsM",
"ColdTaiga", "ExtremeHills+",
"SunflowerPlains", "ExtremeHills+_snowtop",
"RoofedForest", "StoneBeach",
"MesaPlateauFM_grasstop", "Plains",
"ExtremeHillsM", "Plains_beach",
"BirchForestM", "SunflowerPlains",
"Taiga",
"Taiga_beach",
"Forest",
"Forest_beach",
"FlowerForest",
"FlowerForest_beach",
"BirchForest",
"BirchForestM",
"RoofedForest",
"Savanna",
"Savanna_beach",
"SavannaM",
"Jungle",
"Jungle_shore",
"JungleM",
"JungleM_shore",
"JungleEdge",
"JungleEdgeM",
"Swampland",
"Swampland_shore"
}, },
0, 0,
minetest.LIGHT_MAX+1, minetest.LIGHT_MAX+1,