globalStore.writeTo(out);
}
}
private void writeChunkStores() throws IOException {
FileSystemProvider zipProvider = getZipFileSystemProvider();
Path chunksPath = storagePathProvider.getWorldTempPath();
Files.createDirectories(chunksPath);
if (storeChunksInZips) {
Map<Vector3i, FileSystem> newChunkZips = Maps.newHashMap();
for (Map.Entry<Vector3i, CompressedChunkBuilder> entry : compressedChunkBuilders.entrySet()) {
Vector3i chunkPos = entry.getKey();
Vector3i chunkZipPos = storagePathProvider.getChunkZipPosition(chunkPos);
FileSystem zip = newChunkZips.get(chunkZipPos);
if (zip == null) {
Path targetPath = storagePathProvider.getChunkZipTempPath(chunkZipPos);
Files.deleteIfExists(targetPath);
zip = zipProvider.newFileSystem(targetPath, CREATE_ZIP_OPTIONS);
newChunkZips.put(chunkZipPos, zip);
}
Path chunkPath = zip.getPath(storagePathProvider.getChunkFilename(chunkPos));
CompressedChunkBuilder compressedChunkBuilder = entry.getValue();
byte[] compressedChunk = compressedChunkBuilder.buildEncodedChunk();