Class PrefetchLease

java.lang.Object
com.hypixel.hytale.builtin.buildertools.world.PrefetchLease

public final class PrefetchLease extends Object
Holds the columns and sections a prefetch loaded, until the edit behind it has run.

A load does not keep what it loaded. A column outside every player's view radius starts a keep-alive countdown of WorldChunk.KEEP_ALIVE_DEFAULT polls at half a second each, so it has about seven seconds before the unload pass drops it. A prefetch of a large area waits for its slowest column, and a wait longer than that countdown loses the columns that arrived first. The edit then reads holes in ground it asked for and reports them to the player as skipped.

Every hold needs its release, so a lease that is never released keeps its chunks in memory for the life of the world.

  • Constructor Details

    • PrefetchLease

      public PrefetchLease(@Nonnull ChunkStore chunkStore)
  • Method Details

    • holdColumn

      public void holdColumn(@Nullable Ref<ChunkStore> reference)
    • holdSection

      public void holdSection(@Nullable Ref<ChunkStore> reference)
    • release

      public void release()
      Releases every hold. Later calls do nothing, and a hold that arrives after this is not taken.