From 9492f276fc28702716cf2ec85097c93f73d45c53 Mon Sep 17 00:00:00 2001 From: kay27 Date: Wed, 3 Feb 2021 16:08:00 +0400 Subject: [PATCH] Make mcl_spawn compatible with flat mapgen with superflat MCL2 option (but better to have some trees still) --- mods/PLAYER/mcl_spawn/init.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mods/PLAYER/mcl_spawn/init.lua b/mods/PLAYER/mcl_spawn/init.lua index 11dd60e674..103a0c3d93 100644 --- a/mods/PLAYER/mcl_spawn/init.lua +++ b/mods/PLAYER/mcl_spawn/init.lua @@ -227,8 +227,16 @@ end local function next_biome() if #biome_ids < 1 then for _, biome_name in pairs(biomes_white_list) do - table.insert(biome_ids, minetest.get_biome_id(biome_name)) + local biome_id = minetest.get_biome_id(biome_name) + if biome_id then + table.insert(biome_ids, biome_id) + end end + if #biome_ids < 1 then + minetest.log("warning", "[mcl_spawn] No suitable biomes found") + return false + end + minetest.log("action", "[mcl_spawn] Suitable biomes found: "..tostring(#biome_ids)) end while check <= checks do local biome_data = minetest.get_biome_data(cp)