Package net.hollowcube.polar
Class PolarLoader
java.lang.Object
net.hollowcube.polar.PolarLoader
- All Implemented Interfaces:
net.minestom.server.instance.IChunkLoader
-
Constructor Summary
ConstructorsConstructorDescriptionPolarLoader(@NotNull InputStream inputStream) PolarLoader(@NotNull Path path) PolarLoader(@NotNull PolarWorld world) -
Method Summary
Modifier and TypeMethodDescription@NotNull CompletableFuture<@Nullable net.minestom.server.instance.Chunk> loadChunk(@NotNull net.minestom.server.instance.Instance instance, int chunkX, int chunkZ) voidloadInstance(@NotNull net.minestom.server.instance.Instance instance) @NotNull CompletableFuture<Void> saveChunk(@NotNull net.minestom.server.instance.Chunk chunk) @NotNull CompletableFuture<Void> saveChunks(@NotNull Collection<net.minestom.server.instance.Chunk> chunks) @NotNull CompletableFuture<Void> saveInstance(@NotNull net.minestom.server.instance.Instance instance) @NotNull PolarLoadersetLoadLighting(boolean loadLighting) @NotNull PolarLoadersetParallel(boolean parallel) Sets the loader to save and load in parallel.@NotNull PolarLoadersetWorldAccess(@NotNull PolarWorldAccess worldAccess) booleanbooleanvoidunloadChunk(net.minestom.server.instance.Chunk chunk) @NotNull PolarWorldworld()
-
Constructor Details
-
PolarLoader
- Throws:
IOException
-
PolarLoader
- Throws:
IOException
-
PolarLoader
-
-
Method Details
-
world
-
setWorldAccess
@Contract("_ -> this") @NotNull public @NotNull PolarLoader setWorldAccess(@NotNull @NotNull PolarWorldAccess worldAccess) -
setParallel
Sets the loader to save and load in parallel.
The Polar loader on its own supports parallel load out of the box, but a user implementation ofPolarWorldAccessmay not support parallel operations, so care must be taken when enabling this option.- Parameters:
parallel- True to load and save chunks in parallel, false otherwise.- Returns:
- this
-
setLoadLighting
-
supportsParallelLoading
public boolean supportsParallelLoading()- Specified by:
supportsParallelLoadingin interfacenet.minestom.server.instance.IChunkLoader
-
loadInstance
public void loadInstance(@NotNull @NotNull net.minestom.server.instance.Instance instance) - Specified by:
loadInstancein interfacenet.minestom.server.instance.IChunkLoader
-
loadChunk
@NotNull public @NotNull CompletableFuture<@Nullable net.minestom.server.instance.Chunk> loadChunk(@NotNull @NotNull net.minestom.server.instance.Instance instance, int chunkX, int chunkZ) - Specified by:
loadChunkin interfacenet.minestom.server.instance.IChunkLoader
-
supportsParallelSaving
public boolean supportsParallelSaving()- Specified by:
supportsParallelSavingin interfacenet.minestom.server.instance.IChunkLoader
-
saveInstance
@NotNull public @NotNull CompletableFuture<Void> saveInstance(@NotNull @NotNull net.minestom.server.instance.Instance instance) - Specified by:
saveInstancein interfacenet.minestom.server.instance.IChunkLoader
-
unloadChunk
public void unloadChunk(net.minestom.server.instance.Chunk chunk) - Specified by:
unloadChunkin interfacenet.minestom.server.instance.IChunkLoader
-
saveChunks
@NotNull public @NotNull CompletableFuture<Void> saveChunks(@NotNull @NotNull Collection<net.minestom.server.instance.Chunk> chunks) - Specified by:
saveChunksin interfacenet.minestom.server.instance.IChunkLoader
-
saveChunk
@NotNull public @NotNull CompletableFuture<Void> saveChunk(@NotNull @NotNull net.minestom.server.instance.Chunk chunk) - Specified by:
saveChunkin interfacenet.minestom.server.instance.IChunkLoader
-