From f985fcf5c5390b5a4de6fe4fee71c867c642c57a Mon Sep 17 00:00:00 2001 From: teknomunk Date: Tue, 18 Jun 2024 06:22:16 -0500 Subject: [PATCH] Have the list of biomes automatically generated --- mods/ENTITIES/mcl_mobs/spawning.lua | 170 ++-------------------------- 1 file changed, 8 insertions(+), 162 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 0c2fe3798..ca8ec4f26 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -99,168 +99,7 @@ mcl_log("Percentage of hostile spawns are group: " .. hostile_group_percentage_s local mobs_spawn = minetest.settings:get_bool("mobs_spawn", true) ~= false local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= false --- THIS IS THE BIG LIST OF ALL BIOMES - used for programming/updating mobs --- Also used for missing parameter --- Please update the list when adding new biomes! - -local list_of_all_biomes = { - - -- underground: - - "FlowerForest_underground", - "JungleEdge_underground", - "ColdTaiga_underground", - "IcePlains_underground", - "IcePlainsSpikes_underground", - "MegaTaiga_underground", - "Taiga_underground", - "ExtremeHills+_underground", - "JungleM_underground", - "ExtremeHillsM_underground", - "JungleEdgeM_underground", - "MangroveSwamp_underground", - - -- ocean: - - "RoofedForest_ocean", - "JungleEdgeM_ocean", - "BirchForestM_ocean", - "BirchForest_ocean", - "IcePlains_deep_ocean", - "Jungle_deep_ocean", - "Savanna_ocean", - "MesaPlateauF_ocean", - "ExtremeHillsM_deep_ocean", - "Savanna_deep_ocean", - "SunflowerPlains_ocean", - "Swampland_deep_ocean", - "Swampland_ocean", - "MegaSpruceTaiga_deep_ocean", - "ExtremeHillsM_ocean", - "JungleEdgeM_deep_ocean", - "SunflowerPlains_deep_ocean", - "BirchForest_deep_ocean", - "IcePlainsSpikes_ocean", - "Mesa_ocean", - "StoneBeach_ocean", - "Plains_deep_ocean", - "JungleEdge_deep_ocean", - "SavannaM_deep_ocean", - "Desert_deep_ocean", - "Mesa_deep_ocean", - "ColdTaiga_deep_ocean", - "Plains_ocean", - "MesaPlateauFM_ocean", - "Forest_deep_ocean", - "JungleM_deep_ocean", - "FlowerForest_deep_ocean", - "MushroomIsland_ocean", - "MegaTaiga_ocean", - "StoneBeach_deep_ocean", - "IcePlainsSpikes_deep_ocean", - "ColdTaiga_ocean", - "SavannaM_ocean", - "MesaPlateauF_deep_ocean", - "MesaBryce_deep_ocean", - "ExtremeHills+_deep_ocean", - "ExtremeHills_ocean", - "MushroomIsland_deep_ocean", - "Forest_ocean", - "MegaTaiga_deep_ocean", - "JungleEdge_ocean", - "MesaBryce_ocean", - "MegaSpruceTaiga_ocean", - "ExtremeHills+_ocean", - "Jungle_ocean", - "RoofedForest_deep_ocean", - "IcePlains_ocean", - "FlowerForest_ocean", - "ExtremeHills_deep_ocean", - "MesaPlateauFM_deep_ocean", - "Desert_ocean", - "Taiga_ocean", - "BirchForestM_deep_ocean", - "Taiga_deep_ocean", - "JungleM_ocean", - "MangroveSwamp_ocean", - "MangroveSwamp_deep_ocean", - - -- water or beach? - - "MesaPlateauFM_sandlevel", - "MesaPlateauF_sandlevel", - "MesaBryce_sandlevel", - "Mesa_sandlevel", - - -- beach: - - "FlowerForest_beach", - "Forest_beach", - "StoneBeach", - "ColdTaiga_beach_water", - "Taiga_beach", - "Savanna_beach", - "Plains_beach", - "ExtremeHills_beach", - "ColdTaiga_beach", - "Swampland_shore", - "MushroomIslandShore", - "JungleM_shore", - "Jungle_shore", - "BambooJungleM_shore", - "BambooJungle_shore", - "MangroveSwamp_shore", - - -- dimension biome: - - "Nether", - "BasaltDelta", - "CrimsonForest", - "WarpedForest", - "SoulsandValley", - "End", - - -- Overworld regular: - - "Mesa", - "FlowerForest", - "Swampland", - "Taiga", - "ExtremeHills", - "ExtremeHillsM", - "ExtremeHills+_snowtop", - "Jungle", - "Savanna", - "BirchForest", - "MegaSpruceTaiga", - "MegaTaiga", - "ExtremeHills+", - "Forest", - "Plains", - "Desert", - "ColdTaiga", - "MushroomIsland", - "IcePlainsSpikes", - "SunflowerPlains", - "IcePlains", - "RoofedForest", - "ExtremeHills+_snowtop", - "MesaPlateauFM_grasstop", - "JungleEdgeM", - "JungleM", - "BirchForestM", - "MesaPlateauF", - "MesaPlateauFM", - "MesaPlateauF_grasstop", - "MesaBryce", - "JungleEdge", - "SavannaM", - "MangroveSwamp", - "BambooJungle", - "BambooJungleEdge", - "BambooJungleEdgeM", - "BambooJungleM", -} +local list_of_all_biomes = {} -- count how many mobs are in an area local function count_mobs(pos,r,mob_type) @@ -1282,3 +1121,10 @@ minetest.register_chatcommand("mobstats",{ output_mob_stats(mob_counts_wide, total_mobs, true) end }) + +minetest.register_on_mods_loaded(function() + for _,def in pairs(minetest.registered_biomes) do + table.insert(list_of_all_biomes, def.name) + end +end) +