minerender 2.1.0-alpha.142 → 2.1.0-alpha.144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -785,7 +785,10 @@ declare function toRadians(degrees: number): number;
785
785
  declare function toDegrees(radians: number): number;
786
786
  /** Resolves after a delay in milliseconds. */
787
787
  declare function sleep(timeout: number): Promise<void>;
788
- /** Yields to the next macrotask without timer clamping when the platform supports it. */
788
+ /**
789
+ * Yields to the next macrotask without timer clamping when the platform supports it.
790
+ * Not `scheduler.yield()`: Chrome runs its continuations ahead of rendering, so chained yields delay frames.
791
+ */
789
792
  declare function yieldToEventLoop(): Promise<void>;
790
793
  /** Reduces an angle modulo 360, retaining a negative sign for negative inputs. */
791
794
  declare function clampRotationDegrees(deg: number): number;
@@ -4021,6 +4024,8 @@ declare class SectionModels {
4021
4024
  pick(position?: Readonly<TripleArray>): SectionMeshTemplate[];
4022
4025
  biomeTint?: boolean;
4023
4026
  } | undefined>;
4027
+ /** Starts loading the state's models and atlases so a later `prepareState` with the same properties finds them loaded. */
4028
+ preload(blockState: BlockState, properties?: BlockStateProperties): Promise<void>;
4024
4029
  private state;
4025
4030
  /** Returns the shared still/flow atlas used by per-block fluid objects. */
4026
4031
  fluidAtlas(kind: FluidKind, root?: string): Promise<TextureAtlas>;
@@ -4135,6 +4140,7 @@ declare class Chunk<SectionMeshing extends boolean = false> {
4135
4140
  /** Replaces every cell from parsed section data. The caller refreshes neighbor culling. */
4136
4141
  placeSection(data: ChunkData): Promise<void>;
4137
4142
  private replaceSection;
4143
+ private createBlockObject;
4138
4144
  private positionAt;
4139
4145
  /** Refreshes saved lighting after adjacent columns load or unload, including columns with only light data. */
4140
4146
  refreshLight(indices?: Iterable<number>): Promise<void>;
@@ -4284,6 +4290,12 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
4284
4290
  private placeChunkGroups;
4285
4291
  /** Replaces a chunk column's blocks, biomes, and saved light and, with `renderEntities`, its supported saved mobs. */
4286
4292
  placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
4293
+ /**
4294
+ * Replaces parsed columns in input order, then refreshes neighboring geometry once.
4295
+ * Duplicate coordinates retain their order. A failed column stops placement; queued refreshes finish before rejection.
4296
+ */
4297
+ placeChunks(chunks: readonly AnvilChunk[]): Promise<void>;
4298
+ private placeColumn;
4287
4299
  /**
4288
4300
  * Removes blocks and owned entities at chunk-column coordinates, then refreshes neighboring faces and fluids.
4289
4301
  * Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
@@ -4316,7 +4328,7 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
4316
4328
  interface MineRenderWorldOptions<SectionMeshing extends boolean = boolean> {
4317
4329
  /** Render supported saved mobs at their position and yaw, including supported appearance fields. Defaults to false. */
4318
4330
  renderEntities?: boolean;
4319
- /** Merge static opaque cubes into section meshes. Merged blocks have no individual object. */
4331
+ /** Merge block models of any shape and fluid surfaces into per-section meshes; block entities keep individual objects. Merged blocks have no individual object. */
4320
4332
  sectionMeshing?: SectionMeshing;
4321
4333
  /** Shade blocks and fluids with saved sky/block light. Missing or invalid data keeps preview brightness. Defaults to false. Requires `sectionMeshing`. */
4322
4334
  savedLighting?: boolean;
@@ -4326,7 +4338,7 @@ interface MineRenderWorldOptions<SectionMeshing extends boolean = boolean> {
4326
4338
  ambientOcclusion?: boolean;
4327
4339
  /** Average neighboring biome colors within this horizontal radius, from 0 to 7 blocks. Defaults to 0 (off). Requires `sectionMeshing`. */
4328
4340
  biomeBlendRadius?: number;
4329
- /** Maximum width and height of each section atlas page, in pixels. */
4341
+ /** Maximum width and height of each section atlas page, in pixels. Defaults to 2048. */
4330
4342
  maxAtlasSize?: number;
4331
4343
  }
4332
4344
 
@@ -4371,10 +4383,11 @@ declare class WorldStreamer {
4371
4383
  private desired;
4372
4384
  private center?;
4373
4385
  private loading?;
4386
+ private readonly reads;
4374
4387
  private running?;
4375
4388
  private disposal?;
4376
4389
  private disposed;
4377
- constructor(world: Pick<MineRenderWorld<boolean>, "placeChunk" | "unloadChunkColumns">, source: WorldChunkSource, options?: WorldStreamerOptions);
4390
+ constructor(world: Pick<MineRenderWorld<boolean>, "placeChunk" | "unloadChunkColumns"> & Partial<Pick<MineRenderWorld<boolean>, "placeChunks">>, source: WorldChunkSource, options?: WorldStreamerOptions);
4378
4391
  /** Returns absolute coordinates of successfully placed columns, including retained columns. */
4379
4392
  get loadedChunks(): readonly {
4380
4393
  x: number;
@@ -4407,6 +4420,10 @@ declare class WorldStreamer {
4407
4420
  /** Aborts source reads, waits for active work, then unloads owned columns. The world and source remain caller-owned. */
4408
4421
  dispose(): Promise<void>;
4409
4422
  private drain;
4423
+ private fillReadSlots;
4424
+ /** Places only the ready prefix, so later source reads cannot delay the nearest ready column. */
4425
+ private placeReadyChunks;
4426
+ private placeOwnedColumns;
4410
4427
  private needsLoad;
4411
4428
  private unloadMany;
4412
4429
  private validateChunk;
@@ -785,7 +785,10 @@ declare function toRadians(degrees: number): number;
785
785
  declare function toDegrees(radians: number): number;
786
786
  /** Resolves after a delay in milliseconds. */
787
787
  declare function sleep(timeout: number): Promise<void>;
788
- /** Yields to the next macrotask without timer clamping when the platform supports it. */
788
+ /**
789
+ * Yields to the next macrotask without timer clamping when the platform supports it.
790
+ * Not `scheduler.yield()`: Chrome runs its continuations ahead of rendering, so chained yields delay frames.
791
+ */
789
792
  declare function yieldToEventLoop(): Promise<void>;
790
793
  /** Reduces an angle modulo 360, retaining a negative sign for negative inputs. */
791
794
  declare function clampRotationDegrees(deg: number): number;
@@ -4021,6 +4024,8 @@ declare class SectionModels {
4021
4024
  pick(position?: Readonly<TripleArray>): SectionMeshTemplate[];
4022
4025
  biomeTint?: boolean;
4023
4026
  } | undefined>;
4027
+ /** Starts loading the state's models and atlases so a later `prepareState` with the same properties finds them loaded. */
4028
+ preload(blockState: BlockState, properties?: BlockStateProperties): Promise<void>;
4024
4029
  private state;
4025
4030
  /** Returns the shared still/flow atlas used by per-block fluid objects. */
4026
4031
  fluidAtlas(kind: FluidKind, root?: string): Promise<TextureAtlas>;
@@ -4135,6 +4140,7 @@ declare class Chunk<SectionMeshing extends boolean = false> {
4135
4140
  /** Replaces every cell from parsed section data. The caller refreshes neighbor culling. */
4136
4141
  placeSection(data: ChunkData): Promise<void>;
4137
4142
  private replaceSection;
4143
+ private createBlockObject;
4138
4144
  private positionAt;
4139
4145
  /** Refreshes saved lighting after adjacent columns load or unload, including columns with only light data. */
4140
4146
  refreshLight(indices?: Iterable<number>): Promise<void>;
@@ -4284,6 +4290,12 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
4284
4290
  private placeChunkGroups;
4285
4291
  /** Replaces a chunk column's blocks, biomes, and saved light and, with `renderEntities`, its supported saved mobs. */
4286
4292
  placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
4293
+ /**
4294
+ * Replaces parsed columns in input order, then refreshes neighboring geometry once.
4295
+ * Duplicate coordinates retain their order. A failed column stops placement; queued refreshes finish before rejection.
4296
+ */
4297
+ placeChunks(chunks: readonly AnvilChunk[]): Promise<void>;
4298
+ private placeColumn;
4287
4299
  /**
4288
4300
  * Removes blocks and owned entities at chunk-column coordinates, then refreshes neighboring faces and fluids.
4289
4301
  * Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
@@ -4316,7 +4328,7 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
4316
4328
  interface MineRenderWorldOptions<SectionMeshing extends boolean = boolean> {
4317
4329
  /** Render supported saved mobs at their position and yaw, including supported appearance fields. Defaults to false. */
4318
4330
  renderEntities?: boolean;
4319
- /** Merge static opaque cubes into section meshes. Merged blocks have no individual object. */
4331
+ /** Merge block models of any shape and fluid surfaces into per-section meshes; block entities keep individual objects. Merged blocks have no individual object. */
4320
4332
  sectionMeshing?: SectionMeshing;
4321
4333
  /** Shade blocks and fluids with saved sky/block light. Missing or invalid data keeps preview brightness. Defaults to false. Requires `sectionMeshing`. */
4322
4334
  savedLighting?: boolean;
@@ -4326,7 +4338,7 @@ interface MineRenderWorldOptions<SectionMeshing extends boolean = boolean> {
4326
4338
  ambientOcclusion?: boolean;
4327
4339
  /** Average neighboring biome colors within this horizontal radius, from 0 to 7 blocks. Defaults to 0 (off). Requires `sectionMeshing`. */
4328
4340
  biomeBlendRadius?: number;
4329
- /** Maximum width and height of each section atlas page, in pixels. */
4341
+ /** Maximum width and height of each section atlas page, in pixels. Defaults to 2048. */
4330
4342
  maxAtlasSize?: number;
4331
4343
  }
4332
4344
 
@@ -4371,10 +4383,11 @@ declare class WorldStreamer {
4371
4383
  private desired;
4372
4384
  private center?;
4373
4385
  private loading?;
4386
+ private readonly reads;
4374
4387
  private running?;
4375
4388
  private disposal?;
4376
4389
  private disposed;
4377
- constructor(world: Pick<MineRenderWorld<boolean>, "placeChunk" | "unloadChunkColumns">, source: WorldChunkSource, options?: WorldStreamerOptions);
4390
+ constructor(world: Pick<MineRenderWorld<boolean>, "placeChunk" | "unloadChunkColumns"> & Partial<Pick<MineRenderWorld<boolean>, "placeChunks">>, source: WorldChunkSource, options?: WorldStreamerOptions);
4378
4391
  /** Returns absolute coordinates of successfully placed columns, including retained columns. */
4379
4392
  get loadedChunks(): readonly {
4380
4393
  x: number;
@@ -4407,6 +4420,10 @@ declare class WorldStreamer {
4407
4420
  /** Aborts source reads, waits for active work, then unloads owned columns. The world and source remain caller-owned. */
4408
4421
  dispose(): Promise<void>;
4409
4422
  private drain;
4423
+ private fillReadSlots;
4424
+ /** Places only the ready prefix, so later source reads cannot delay the nearest ready column. */
4425
+ private placeReadyChunks;
4426
+ private placeOwnedColumns;
4410
4427
  private needsLoad;
4411
4428
  private unloadMany;
4412
4429
  private validateChunk;