1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Add core.get_mapgen_chunksize() (#16289)

This commit is contained in:
sfan5 2025-06-29 17:19:40 +02:00 committed by GitHub
parent fcbf05fc30
commit fd0ca20ce9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 3 deletions

View file

@ -29,6 +29,6 @@ if core.ipc_cas("unittests:mg_once", nil, true) then
end
core.register_on_generated(function(vm, pos1, pos2, blockseed)
local n = tonumber(core.get_mapgen_setting("chunksize")) * 16 - 1
assert(pos2:subtract(pos1) == vector.new(n, n, n))
local cs = core.get_mapgen_chunksize()
assert(pos2:subtract(pos1) == cs:multiply(core.MAP_BLOCKSIZE):subtract(1))
end)