From bf4bf9a0cc60a1a15f1ddbfed314ec5a9c75561c Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 8 Apr 2021 06:10:07 -0400 Subject: [PATCH] Ignore default or void dimensions --- mods/ENTITIES/mcl_mobs/spawning.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 9ea774ba9c..765c78ba04 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -551,11 +551,16 @@ if mobs_spawn then minetest.register_globalstep(function(dtime) timer = timer + dtime if timer >= 15 then - timer = 0--15--0 + timer = 15--0 for _,player in ipairs(minetest.get_connected_players()) do for i = 1,math.random(5) do local player_pos = player:get_pos() local _,dimension = mcl_worlds.y_to_layer(player_pos.y) + + if dimension == "void" or dimension == "default" then + goto continue -- ignore void and unloaded area + end + local min,max = decypher_limits(player_pos.y) local goal_pos = position_calculation(player_pos) @@ -566,7 +571,7 @@ if mobs_spawn then goto continue --skip if in unloaded area end - --print(minetest.get_biome_name(gotten_biome.biome)) + print(minetest.get_biome_name(gotten_biome.biome)) local mob_def = spawn_dictionary[dimension][math.random(1,#spawn_dictionary[dimension])]