Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local BLOCKSIZE = core.MAP_BLOCKSIZE
- local squarsize = 1024
- local loadx = squarsize
- local loady = 256
- local loadz = squarsize
- local loadxblocks = math.floor(loadx/BLOCKSIZE)
- local loadyblocks = math.floor(loady/BLOCKSIZE)
- local loadzblocks = math.floor(loadz/BLOCKSIZE)
- local loadxblockshalf = math.floor(loadxblocks/2)
- local loadyblockshalf = math.floor(loadyblocks/2)
- local loadzblockshalf = math.floor(loadzblocks/2)
- local pos1 = { x = - loadxblockshalf, y = - loadyblockshalf, z = - loadzblockshalf }
- local pos2 = { x = loadxblockshalf, y = loadyblockshalf, z = loadzblockshalf }
- function emerge()
- minetest.emerge_area(pos1, pos2)
- end
- function loadmap()
- minetest.chat_send_all("start force load")
- for ix = - loadxblockshalf, loadxblockshalf , 1
- do
- for iy = - loadyblockshalf, loadyblockshalf , 1
- do
- for iz = - loadzblockshalf, loadzblockshalf , 1
- do
- minetest.chat_send_all("loading " .. tostring(ix) .. " , " .. tostring(iy) .. " , " .. tostring(iz) )
- minetest.chat_send_all(tostring(minetest.forceload_block({ x = ix*16, y = iy*16, z = iz*16 })))
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement