@ParametersAreNonnullByDefault public interface LevelProvider extends PlayerDataProvider, Closeable
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
forEachChunk(ChunkBuilder.Factory factory,
BiConsumer<Chunk,Throwable> consumer)
Iterate over all chunks that the provider has.
|
String |
getLevelId()
Level ID
|
CompletableFuture<LoadState> |
loadLevelData(LevelData levelData)
Load level data into given
LevelData object |
CompletableFuture<Chunk> |
readChunk(ChunkBuilder chunkBuilder)
Reads chunk from provider asynchronously
|
CompletableFuture<Void> |
saveChunk(Chunk chunk)
Saves chunk to provider asynchronously
|
CompletableFuture<Void> |
saveLevelData(LevelData levelData)
Save level data from given
LevelData object |
String getLevelId()
CompletableFuture<Chunk> readChunk(ChunkBuilder chunkBuilder)
chunkBuilder - builderCompletableFuture<Void> saveChunk(Chunk chunk)
chunk - chunkCompletableFuture<Void> forEachChunk(ChunkBuilder.Factory factory, BiConsumer<Chunk,Throwable> consumer)
consumer - UnsupportedOperationException - if the provider does not support chunk iteration.CompletableFuture<LoadState> loadLevelData(LevelData levelData)
LevelData objectlevelData - levelData to loadCompletableFuture<Void> saveLevelData(LevelData levelData)
LevelData objectlevelData - levelData to saveCopyright © 2020. All rights reserved.