Package net.minestom.server.instance
Class AnvilLoader
java.lang.Object
net.minestom.server.instance.AnvilLoader
- All Implemented Interfaces:
IChunkLoader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull CompletableFuture<@Nullable Chunk> Loads aChunk, all blocks should be set since theChunkGeneratoris not applied.voidloadInstance(@NotNull Instance instance) Loads instance data from the loader.@NotNull CompletableFuture<Void> Saves aChunkwith an optional callback for when it is done.@NotNull CompletableFuture<Void> saveInstance(@NotNull Instance instance) booleanDoes thisIChunkLoaderallow for multi-threaded loading ofChunk?booleanDoes thisIChunkLoaderallow for multi-threaded saving ofChunk?voidunloadChunk(Chunk chunk) Unload a given chunk.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minestom.server.instance.IChunkLoader
saveChunks
-
Constructor Details
-
AnvilLoader
-
AnvilLoader
-
-
Method Details
-
loadInstance
Description copied from interface:IChunkLoaderLoads instance data from the loader.- Specified by:
loadInstancein interfaceIChunkLoader- Parameters:
instance- the instance to retrieve the data from
-
loadChunk
@NotNull public @NotNull CompletableFuture<@Nullable Chunk> loadChunk(@NotNull @NotNull Instance instance, int chunkX, int chunkZ) Description copied from interface:IChunkLoaderLoads aChunk, all blocks should be set since theChunkGeneratoris not applied.- Specified by:
loadChunkin interfaceIChunkLoader- Parameters:
instance- theInstancewhere theChunkbelongchunkX- the chunk XchunkZ- the chunk Z- Returns:
- a
CompletableFuturecontaining the chunk, or null if not present
-
saveInstance
- Specified by:
saveInstancein interfaceIChunkLoader
-
saveChunk
Description copied from interface:IChunkLoaderSaves aChunkwith an optional callback for when it is done.- Specified by:
saveChunkin interfaceIChunkLoader- Parameters:
chunk- theChunkto save- Returns:
- a
CompletableFutureexecuted when theChunkis done saving, should be called even if the saving failed (you can throw an exception).
-
unloadChunk
Unload a given chunk. Also unloads a region when no chunk from that region is loaded.- Specified by:
unloadChunkin interfaceIChunkLoader- Parameters:
chunk- the chunk to unload
-
supportsParallelLoading
public boolean supportsParallelLoading()Description copied from interface:IChunkLoaderDoes thisIChunkLoaderallow for multi-threaded loading ofChunk?- Specified by:
supportsParallelLoadingin interfaceIChunkLoader- Returns:
- true if the chunk loader supports parallel loading
-
supportsParallelSaving
public boolean supportsParallelSaving()Description copied from interface:IChunkLoaderDoes thisIChunkLoaderallow for multi-threaded saving ofChunk?- Specified by:
supportsParallelSavingin interfaceIChunkLoader- Returns:
- true if the chunk loader supports parallel saving
-