Class: WorldStreamer
Defined in: packages/minerender/src/world/WorldStreamer.ts:35
Loads nearby chunk columns in distance order and unloads distant columns. Updates coalesce to the latest center and serialize world mutations. Use a dedicated world: the streamer replaces columns it loads, and callers must await disposal before editing that world. The source remains caller-owned. Lighting, biome tint, and LOD are not added by streaming.
Constructors
Constructor
new WorldStreamer(
world,
source,
options?
): WorldStreamer;Defined in: packages/minerender/src/world/WorldStreamer.ts:50
Parameters
| Parameter | Type |
|---|---|
world | Pick<MineRenderWorld<boolean>, "placeChunk" | "unloadChunkColumns"> & Partial<Pick<MineRenderWorld<boolean>, "placeChunks">> |
source | WorldChunkSource |
options | WorldStreamerOptions |
Returns
WorldStreamer
Accessors
failedChunks
Get Signature
get failedChunks(): readonly object[];Defined in: packages/minerender/src/world/WorldStreamer.ts:70
Returns source failures retained within the unload radius. Failed columns do not block other loads.
Returns
readonly object[]
loadedChunks
Get Signature
get loadedChunks(): readonly object[];Defined in: packages/minerender/src/world/WorldStreamer.ts:65
Returns absolute coordinates of successfully placed columns, including retained columns.
Returns
readonly object[]
pendingChunks
Get Signature
get pendingChunks(): number;Defined in: packages/minerender/src/world/WorldStreamer.ts:75
Counts desired columns still waiting for a source read or placement, including the active column.
Returns
number
Methods
dispose()
dispose(): Promise<void>;Defined in: packages/minerender/src/world/WorldStreamer.ts:129
Aborts source reads, waits for active work, then unloads owned columns. The world and source remain caller-owned.
Returns
Promise<void>
retryFailedChunks()
retryFailedChunks(): Promise<void>;Defined in: packages/minerender/src/world/WorldStreamer.ts:122
Forgets recorded source failures and retries desired columns at the latest center.
Returns
Promise<void>
update()
update(x, z): Promise<void>;Defined in: packages/minerender/src/world/WorldStreamer.ts:87
Updates the center in absolute chunk coordinates. Repeated calls share the active drain. Source failures are recorded in failedChunks; other columns continue loading. Missing and failed columns are remembered within the retention radius. Call retryFailedChunks to retry source failures. Placement and unload failures reject the drain; call update again to retry those operations. Reads outside the latest load radius receive an abort signal; placement finishes before unloading. Sources should represent an unchanged world during streaming.
Parameters
| Parameter | Type |
|---|---|
x | number |
z | number |
Returns
Promise<void>
updatePosition()
updatePosition(position): Promise<void>;Defined in: packages/minerender/src/world/WorldStreamer.ts:116
Updates from a camera or view-center position in scene units. One chunk spans 256 scene units.
Parameters
| Parameter | Type |
|---|---|
position | { x: number; z: number; } |
position.x | number |
position.z | number |
Returns
Promise<void>