Class PolarLoader

java.lang.Object
net.hollowcube.polar.PolarLoader
All Implemented Interfaces:
net.minestom.server.instance.IChunkLoader

public class PolarLoader extends Object implements net.minestom.server.instance.IChunkLoader
  • Constructor Details

  • Method Details

    • world

      @NotNull public @NotNull PolarWorld world()
    • setWorldAccess

      @Contract("_ -> this") @NotNull public @NotNull PolarLoader setWorldAccess(@NotNull @NotNull PolarWorldAccess worldAccess)
    • setParallel

      @Contract("_ -> this") @NotNull public @NotNull PolarLoader setParallel(boolean parallel)
      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 of PolarWorldAccess may 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

      @Contract("_ -> this") @NotNull public @NotNull PolarLoader setLoadLighting(boolean loadLighting)
    • supportsParallelLoading

      public boolean supportsParallelLoading()
      Specified by:
      supportsParallelLoading in interface net.minestom.server.instance.IChunkLoader
    • loadInstance

      public void loadInstance(@NotNull @NotNull net.minestom.server.instance.Instance instance)
      Specified by:
      loadInstance in interface net.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:
      loadChunk in interface net.minestom.server.instance.IChunkLoader
    • supportsParallelSaving

      public boolean supportsParallelSaving()
      Specified by:
      supportsParallelSaving in interface net.minestom.server.instance.IChunkLoader
    • saveInstance

      @NotNull public @NotNull CompletableFuture<Void> saveInstance(@NotNull @NotNull net.minestom.server.instance.Instance instance)
      Specified by:
      saveInstance in interface net.minestom.server.instance.IChunkLoader
    • unloadChunk

      public void unloadChunk(net.minestom.server.instance.Chunk chunk)
      Specified by:
      unloadChunk in interface net.minestom.server.instance.IChunkLoader
    • saveChunks

      @NotNull public @NotNull CompletableFuture<Void> saveChunks(@NotNull @NotNull Collection<net.minestom.server.instance.Chunk> chunks)
      Specified by:
      saveChunks in interface net.minestom.server.instance.IChunkLoader
    • saveChunk

      @NotNull public @NotNull CompletableFuture<Void> saveChunk(@NotNull @NotNull net.minestom.server.instance.Chunk chunk)
      Specified by:
      saveChunk in interface net.minestom.server.instance.IChunkLoader