public interface ChunkProvider
Known subtypesStreamingTerrain.MemoryChunkProvider
Supplies and persists
TerrainChunks 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.Methods
public abstract TerrainChunk loadChunk(int cx, int cz) | Loads (or generates) the chunk at the given chunk coordinates. |
public abstract void saveChunk(TerrainChunk chunk) | Persists a dirty chunk being evicted from memory. |
Method details
loadChunk
public abstract TerrainChunk loadChunk(int cx, int cz)Loads (or generates) the chunk at the given chunk coordinates. Never returns null.
saveChunk
public abstract void saveChunk(TerrainChunk chunk)Persists a dirty chunk being evicted from memory. No-op for read-only/procedural sources.