mirror of
https://github.com/mt-mods/biome_lib.git
synced 2024-11-14 14:40:21 +01:00
split generated map chunks into mapblock-sized pieces as they're logged
to reduce lag/latency at a tiny cost of overall throughput.
This commit is contained in:
parent
353ca0cbd4
commit
228296411e
|
@ -52,9 +52,23 @@ function biome_lib:find_open_side(pos)
|
|||
return nil
|
||||
end
|
||||
|
||||
-- "Record" the chunks being generated by the core mapgen
|
||||
-- "Record" the map chunks being generated by the core mapgen,
|
||||
-- split into individual mapblocks to reduce lag
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
biome_lib.blocklist_aircheck[#biome_lib.blocklist_aircheck + 1] = { minp, maxp }
|
||||
biome_lib.blocklist_no_aircheck[#biome_lib.blocklist_no_aircheck + 1] = { minp, maxp }
|
||||
for x = 0, 5 do
|
||||
local minx = minp.x + x*16
|
||||
for y = 0, 5 do
|
||||
local miny = minp.y + y*16
|
||||
for z = 0, 5 do
|
||||
local minz = minp.z + z*16
|
||||
|
||||
local bmin = {x=minx, y=miny, z=minz}
|
||||
local bmax = {x=minx + 15, y=miny + 15, z=minz + 15}
|
||||
|
||||
biome_lib.blocklist_aircheck[#biome_lib.blocklist_aircheck + 1] = { bmin, bmax }
|
||||
biome_lib.blocklist_no_aircheck[#biome_lib.blocklist_no_aircheck + 1] = { bmin, bmax }
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue
Block a user