Class AnvilLoader

java.lang.Object
net.minestom.server.instance.anvil.AnvilLoader
All Implemented Interfaces:
IChunkLoader

public class AnvilLoader extends Object implements IChunkLoader
  • Constructor Details

    • AnvilLoader

      public AnvilLoader(@NotNull @NotNull Path path)
    • AnvilLoader

      public AnvilLoader(@NotNull @NotNull String path)
  • Method Details

    • loadInstance

      public void loadInstance(@NotNull @NotNull Instance instance)
      Description copied from interface: IChunkLoader
      Loads instance data from the loader.
      Specified by:
      loadInstance in interface IChunkLoader
      Parameters:
      instance - the instance to retrieve the data from
    • loadChunk

      @Nullable public @Nullable Chunk loadChunk(@NotNull @NotNull Instance instance, int chunkX, int chunkZ)
      Description copied from interface: IChunkLoader
      Loads a Chunk, all blocks should be set since the Generator is not applied.
      Specified by:
      loadChunk in interface IChunkLoader
      Parameters:
      instance - the Instance where the Chunk belong
      chunkX - the chunk X
      chunkZ - the chunk Z
      Returns:
      the chunk, or null if not present
    • saveInstance

      public void saveInstance(@NotNull @NotNull Instance instance)
      Specified by:
      saveInstance in interface IChunkLoader
    • saveChunk

      public void saveChunk(@NotNull @NotNull Chunk chunk)
      Description copied from interface: IChunkLoader
      Saves a Chunk with an optional callback for when it is done.
      Specified by:
      saveChunk in interface IChunkLoader
      Parameters:
      chunk - the Chunk to save
    • unloadChunk

      public void unloadChunk(Chunk chunk)
      Unload a given chunk. Also unloads a region when no chunk from that region is loaded.
      Specified by:
      unloadChunk in interface IChunkLoader
      Parameters:
      chunk - the chunk to unload
    • supportsParallelLoading

      public boolean supportsParallelLoading()
      Description copied from interface: IChunkLoader
      Supports for instance/chunk loading in virtual threads.
      Specified by:
      supportsParallelLoading in interface IChunkLoader
      Returns:
      true if the chunk loader supports parallel loading
    • supportsParallelSaving

      public boolean supportsParallelSaving()
      Description copied from interface: IChunkLoader
      Supports for instance/chunk saving in virtual threads.
      Specified by:
      supportsParallelSaving in interface IChunkLoader
      Returns:
      true if the chunk loader supports parallel saving