Allow old blocks to time-out after a while

(default 5 minutes).

Rationale: if a block is old enough, there's a very high probability
that the engine's done screwing around with its neighbors, so it's safe
to process.
This commit is contained in:
Vanessa Dannenberg
2021-04-07 07:10:10 -04:00
parent 0a34e3c7af
commit dd650da443
2 changed files with 9 additions and 3 deletions

View File

@ -56,6 +56,7 @@ end
-- split into individual mapblocks to reduce lag
minetest.register_on_generated(function(minp, maxp, blockseed)
local timestamp = minetest.get_us_time()
for x = 0, 4 do
local minx = minp.x + x*16
for y = 0, 4 do
@ -65,8 +66,8 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
local bmin = {x=minx, y=miny, z=minz}
local bmax = {x=minx + 15, y=miny + 15, z=minz + 15}
biome_lib.block_log[#biome_lib.block_log + 1] = { bmin, bmax, true }
biome_lib.block_log[#biome_lib.block_log + 1] = { bmin, bmax, false }
biome_lib.block_log[#biome_lib.block_log + 1] = { bmin, bmax, true, timestamp }
biome_lib.block_log[#biome_lib.block_log + 1] = { bmin, bmax, false, timestamp }
end
end
end