1
0
Fork 0

Ignore default or void dimensions

This commit is contained in:
jordan4ibanez 2021-04-08 06:10:07 -04:00
parent 8e1e02d1fb
commit bf4bf9a0cc
1 changed files with 7 additions and 2 deletions

View File

@ -551,11 +551,16 @@ if mobs_spawn then
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
timer = timer + dtime timer = timer + dtime
if timer >= 15 then if timer >= 15 then
timer = 0--15--0 timer = 15--0
for _,player in ipairs(minetest.get_connected_players()) do for _,player in ipairs(minetest.get_connected_players()) do
for i = 1,math.random(5) do for i = 1,math.random(5) do
local player_pos = player:get_pos() local player_pos = player:get_pos()
local _,dimension = mcl_worlds.y_to_layer(player_pos.y) 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 min,max = decypher_limits(player_pos.y)
local goal_pos = position_calculation(player_pos) local goal_pos = position_calculation(player_pos)
@ -566,7 +571,7 @@ if mobs_spawn then
goto continue --skip if in unloaded area goto continue --skip if in unloaded area
end 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])] local mob_def = spawn_dictionary[dimension][math.random(1,#spawn_dictionary[dimension])]