# Interface ChunkProvider

All Known Implementing Classes:
  `StreamingTerrain.MemoryChunkProvider`

public interface ChunkProvider
Supplies and persists `TerrainChunk`s for a `StreamingTerrain`. Implementations decide where chunks come from: procedurally generated, bundled resources, `Storage`, or the network. A provider must return a (possibly empty) chunk for any coordinate so the world is seamless.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TerrainChunk`
  `loadChunk(int cx, int cz)`
  Loads (or generates) the chunk at the given chunk coordinates.
  `void`
  `saveChunk(TerrainChunk chunk)`
  Persists a dirty chunk being evicted from memory.

- ## Method Details

  - ### loadChunk

    TerrainChunk loadChunk(int cx, int cz)
    Loads (or generates) the chunk at the given chunk coordinates. Never returns null.

  - ### saveChunk

    void saveChunk(TerrainChunk chunk)
    Persists a dirty chunk being evicted from memory. No-op for read-only/procedural sources.