mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Ignore default or void dimensions
This commit is contained in:
parent
8e1e02d1fb
commit
bf4bf9a0cc
1 changed files with 7 additions and 2 deletions
|
@ -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])]
|
||||
|
||||
|
|
Loading…
Reference in a new issue