minerender 2.1.0-alpha.9 → 2.1.0-beta.1

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.
@@ -1,21 +1,22 @@
1
1
  import * as three from 'three';
2
- import { Vector3, PixelFormat, BoxGeometry, Material, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Scene, Object3DEventMap, Texture, Camera, MOUSE, TOUCH, WebGLRenderer, EventDispatcher, Raycaster, Intersection, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points } from 'three';
2
+ import { Vector3, PixelFormat, BoxGeometry, Material, ColorRepresentation, MeshBasicMaterial, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Box2, Scene, Object3DEventMap, Texture, Camera, MOUSE, TOUCH, WebGLRenderer, EventDispatcher, Raycaster, Intersection, DataTexture, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points, Group } from 'three';
3
3
  import * as nodeCanvas from 'canvas';
4
4
  import { ImageData as ImageData$1, CanvasRenderingContext2D } from 'canvas';
5
- import { AxiosResponse, AxiosRequestConfig } from 'axios';
6
- import { Buffer as Buffer$1 } from 'buffer';
7
- import { NBT } from 'prismarine-nbt';
5
+ import { Buffer } from 'buffer';
6
+ import { NBT, NBTFormat, Metadata } from 'prismarine-nbt';
8
7
  import { ZipReader } from '@zip.js/zip.js';
9
8
  import { AsyncLoadingCache, SimpleCache } from '@inventivetalent/loading-cache';
9
+ import { PLYExporterOptions } from 'three/examples/jsm/exporters/PLYExporter.js';
10
+ export { PLYExporterOptions } from 'three/examples/jsm/exporters/PLYExporter.js';
10
11
  import Stats from 'stats.js';
11
12
  import { EffectComposer } from 'postprocessing';
12
13
 
13
14
  interface AnimatorFunction {
14
- (): void;
15
+ (): boolean | void;
15
16
  }
16
17
 
17
18
  declare enum Axis {
18
- X = "X",
19
+ X = "x",
19
20
  Y = "y",
20
21
  Z = "z"
21
22
  }
@@ -39,6 +40,7 @@ declare enum CubeFaceIndex {
39
40
  NORTH = 5
40
41
  }
41
42
  declare const CUBE_FACES: CubeFace[];
43
+ declare const CUBE_FACE_OFFSETS: readonly [readonly [1, 0, 0], readonly [-1, 0, 0], readonly [0, 1, 0], readonly [0, -1, 0], readonly [0, 0, 1], readonly [0, 0, -1]];
42
44
 
43
45
  interface Disposable {
44
46
  dispose(): void;
@@ -174,6 +176,7 @@ declare class AssetKey extends BasicAssetKey {
174
176
  rootType: "assets" | "data" | string;
175
177
  extension: ".json" | ".png" | string;
176
178
  root?: string | undefined;
179
+ readonly isAssetKey: true;
177
180
  constructor(namespace: string, path: string, assetType?: AssetType | undefined, type?: string | undefined, rootType?: "assets" | "data" | string, extension?: ".json" | ".png" | string, root?: string | undefined);
178
181
  static parse(assetType: AssetType, str: string, origin?: AssetKey): AssetKey;
179
182
  toString(): string;
@@ -196,11 +199,98 @@ interface ListAsset extends MinecraftAsset {
196
199
  files: string[];
197
200
  }
198
201
 
202
+ interface EntityLayer {
203
+ key: BasicAssetKey;
204
+ texture?: AssetKey;
205
+ layer: EntityModelLayer;
206
+ /** How this draw is rendered; defaults to the geometry layer's own mode, then `cutout`. */
207
+ render?: EntityRenderMode;
208
+ /** Label of the state colour that multiplies the texture, from the pass that selected this draw. */
209
+ tint?: string;
210
+ }
211
+ interface EntityModel extends EntityLayer {
212
+ id: string;
213
+ /** Root transform from the dataset; see {@link EntityTransformOp}. */
214
+ transform?: EntityTransformOp[];
215
+ /**
216
+ * Selected draws in draw order; the top-level fields describe the first selection.
217
+ * A key is the geometry layer's name; a further draw of the same geometry (a pass with another texture) is keyed `<layer>#<n>`, from 2.
218
+ */
219
+ layers?: Record<string, EntityLayer>;
220
+ }
221
+ interface EntityModelFile extends MinecraftAsset {
222
+ id: string;
223
+ transform?: EntityTransformOp[];
224
+ layers: Record<string, EntityModelLayer>;
225
+ /** Extra draws vanilla adds on top of `main`, in draw order. */
226
+ passes?: EntityModelPass[];
227
+ }
228
+ /** Vanilla render type of a draw; see the dataset README for the mode table. */
229
+ type EntityRenderMode = "cutout" | "cutout_cull" | "cutout_z_offset" | "solid" | "translucent" | "translucent_emissive" | "eyes" | "energy_swirl" | "breeze_wind" | "water_mask";
230
+ interface EntityModelPass {
231
+ /** Geometry layer of the same file; a pass on `main` draws that geometry again. */
232
+ layer: string;
233
+ /** Present only when it differs from the layer's own. */
234
+ textureLocation?: string;
235
+ /** Present only when it differs from the layer's own. */
236
+ render?: EntityRenderMode;
237
+ /** Entity state that enables the draw, e.g. `powered`; without it the pass is always drawn. */
238
+ when?: string;
239
+ /** State colour that multiplies the texture, e.g. `wool_color`. */
240
+ tint?: string;
241
+ }
242
+ /**
243
+ * One operation vanilla's renderer applies before drawing a model, in call order:
244
+ * each one is applied on top of the previous, so the last reaches the vertices first.
245
+ * Translations use model units and rotations use radians, like part poses.
246
+ */
247
+ type EntityTransformOp = {
248
+ scale: [number, number, number];
249
+ } | {
250
+ translate: [number, number, number];
251
+ } | {
252
+ rotate: [number, number, number];
253
+ };
254
+ interface EntityModelLayer {
255
+ texture: [number, number];
256
+ textureLocation?: string;
257
+ /** Omitted for `cutout`. */
258
+ render?: EntityRenderMode;
259
+ root: EntityModelPart;
260
+ }
261
+ interface EntityModelPart {
262
+ pose: {
263
+ offset: [number, number, number];
264
+ rotation: [number, number, number];
265
+ scale?: [number, number, number];
266
+ };
267
+ texture?: [number, number];
268
+ cubes: EntityModelCube[];
269
+ children: Record<string, EntityModelPart>;
270
+ }
271
+ interface EntityModelCube {
272
+ origin: [number, number, number];
273
+ size: [number, number, number];
274
+ uv: [number, number];
275
+ grow?: [number, number, number];
276
+ mirror?: boolean;
277
+ }
278
+
199
279
  declare class Materials {
200
- private static readonly MISSING_TEXTURE_SRC;
201
280
  static get MISSING_TEXTURE(): Material;
202
281
  static createImage(key: MaterialKey): Material;
203
282
  static createBasicCanvasMaterial(canvas: HTMLCanvasElement, transparent?: boolean, shade?: boolean): Material;
283
+ /** Whether vanilla's render type for the mode culls back faces. */
284
+ static entityModeCulls(mode?: EntityRenderMode): boolean;
285
+ /** UV offset per tick of entity age for the scrolling modes, as vanilla's texture matrix applies it. */
286
+ static entityModeScroll(mode?: EntityRenderMode): [number, number] | undefined;
287
+ /**
288
+ * Entity material for one of vanilla's render types. Entities are unlit here, so the lit and full-bright modes
289
+ * differ only in blending and depth state. Culling is not a material property: {@link entityModeCulls} decides
290
+ * whether the geometry gets inward faces.
291
+ */
292
+ static createEntityCanvasMaterial(canvas: HTMLCanvasElement, mode?: EntityRenderMode, tint?: ColorRepresentation): MeshBasicMaterial;
293
+ static createGuiCanvasMaterial(canvas: HTMLCanvasElement): MeshBasicMaterial;
204
294
  static createShadedCanvasMaterial(canvas: HTMLCanvasElement, transparent?: boolean, shade?: boolean): Material;
205
295
  static getImage(key: MaterialKey): Material;
206
296
  static needsUpdate(mat: Material): void;
@@ -246,7 +336,8 @@ declare enum DisplayPosition {
246
336
  GUI = "gui",
247
337
  HEAD = "head",
248
338
  GROUND = "ground",
249
- FIXED = "fixed"
339
+ FIXED = "fixed",
340
+ ON_SHELF = "on_shelf"
250
341
  }
251
342
  declare const DISPLAY_POSITIONS: DisplayPosition[];
252
343
 
@@ -255,6 +346,46 @@ declare enum GuiLight {
255
346
  SIDE = "side"
256
347
  }
257
348
 
349
+ interface RequestConfig extends RequestInit {
350
+ url: string;
351
+ /** Prepended to relative URLs, preserving any path in the base URL. */
352
+ baseURL?: string;
353
+ /** Timeout per attempt in milliseconds, including body reading. Defaults to 5000; 0 disables it. */
354
+ timeout?: number;
355
+ responseType?: "json" | "arraybuffer";
356
+ }
357
+ interface RequestResponse<T = any> {
358
+ data: T;
359
+ status: number;
360
+ statusText: string;
361
+ headers: Headers;
362
+ /** Final URL after redirects. */
363
+ url: string;
364
+ }
365
+ declare class RequestError extends Error {
366
+ readonly response?: RequestResponse<undefined> | undefined;
367
+ readonly cause?: unknown;
368
+ constructor(message: string, response?: RequestResponse<undefined> | undefined, cause?: unknown);
369
+ }
370
+ declare class Requests {
371
+ private static genericQueue;
372
+ private static mcAssetRequestQueue;
373
+ static genericRequest(request: RequestConfig): Promise<RequestResponse>;
374
+ static mcAssetRequest(request: RequestConfig): Promise<RequestResponse>;
375
+ static setMcAssetRoot(root: string): void;
376
+ /** Counts unsettled calls, including retry delays and requests still running after shutdown. */
377
+ static get queueSizes(): {
378
+ generic: number;
379
+ mcAsset: number;
380
+ };
381
+ /**
382
+ * Permanently stops both queues and rejects waiting, retrying, and future requests.
383
+ * Requests already running can finish. Idle queues hold no timer, so Node can exit without
384
+ * this cleanup. See {@link shutdown}.
385
+ */
386
+ static end(): void;
387
+ }
388
+
258
389
  declare class WrappedImage {
259
390
  readonly dta: ExtractableImageData;
260
391
  constructor(dta: ExtractableImageData);
@@ -278,7 +409,7 @@ interface ImageInfo {
278
409
  width: number;
279
410
  height: number;
280
411
  type?: string;
281
- data: Buffer$1;
412
+ data: Buffer;
282
413
  }
283
414
  declare class ImageLoader {
284
415
  protected static _createImage(): CompatImage;
@@ -290,7 +421,7 @@ declare class ImageLoader {
290
421
  static infoToData(info: ImageInfo): Promise<ImageData>;
291
422
  static getData(src: string): Promise<ImageData>;
292
423
  static getCanvasData(src: string): Promise<ExtractableImageData>;
293
- static processResponse(response: Partial<AxiosResponse>): Promise<ImageInfo>;
424
+ static processResponse(response: Pick<RequestResponse<ArrayBuffer>, "data" | "url">): Promise<ImageInfo>;
294
425
  static loadInfo(src: string): Promise<ImageInfo>;
295
426
  static getInfo(src: string): Promise<ImageInfo>;
296
427
  static loadWrapped(src: string): Promise<WrappedImage>;
@@ -304,7 +435,7 @@ declare const DEFAULT_ELEMENTS: ModelElement[];
304
435
  interface Model extends MinecraftAsset {
305
436
  textures?: IModelTextures;
306
437
  parent?: string;
307
- display?: ModelDisplay;
438
+ display?: Partial<Record<DisplayPosition, ModelDisplay>>;
308
439
  elements?: ModelElement[];
309
440
  hierarchy?: string[];
310
441
  }
@@ -315,11 +446,41 @@ interface BlockModel extends Model {
315
446
  interface ItemModel extends Model {
316
447
  textures?: ItemModelTextures;
317
448
  gui_light?: GuiLight;
318
- }
449
+ special?: SpecialItemRenderer;
450
+ tints?: ItemTintSource[];
451
+ }
452
+ type ItemTintColor = number | TripleArray;
453
+ type ItemTintSource = {
454
+ type: "constant" | "minecraft:constant";
455
+ value: ItemTintColor;
456
+ } | {
457
+ type: "grass" | "minecraft:grass";
458
+ temperature: number;
459
+ downfall: number;
460
+ } | {
461
+ type: "dye" | "minecraft:dye" | "potion" | "minecraft:potion" | "map_color" | "minecraft:map_color" | "firework" | "minecraft:firework" | "team" | "minecraft:team";
462
+ default: ItemTintColor;
463
+ } | {
464
+ type: "custom_model_data" | "minecraft:custom_model_data";
465
+ index?: number;
466
+ default: ItemTintColor;
467
+ };
468
+ type SpecialItemRenderer = {
469
+ type: "chest" | "minecraft:chest";
470
+ texture: string;
471
+ openness?: number;
472
+ } | {
473
+ type: "bed" | "minecraft:bed";
474
+ texture: string;
475
+ } | {
476
+ type: "head" | "minecraft:head";
477
+ kind: string;
478
+ texture?: string;
479
+ animation?: number;
480
+ };
319
481
  interface TextureAsset extends MinecraftAsset, ImageInfo {
320
482
  }
321
483
  interface ModelDisplay {
322
- position?: DisplayPosition;
323
484
  translation?: TripleArray;
324
485
  rotation?: TripleArray;
325
486
  scale?: TripleArray;
@@ -339,13 +500,7 @@ declare function isDoubleArray(obj: any): obj is DoubleArray;
339
500
  declare function isTripleArray(obj: any): obj is TripleArray;
340
501
  declare function isQuadArray(obj: any): obj is QuadArray;
341
502
 
342
- /**
343
- * down up
344
- * east north west south
345
- *
346
- * bottom-left to top-right
347
- * [bl, br, tl, tr]
348
- */
503
+ /** Vanilla Minecraft cube UVs in Three.js BoxGeometry face and vertex order. */
349
504
  declare class MinecraftCubeTexture {
350
505
  readonly u: number;
351
506
  readonly v: number;
@@ -361,12 +516,33 @@ declare class MinecraftCubeTexture {
361
516
  getUvSouth(w: number, h: number, l: number): QuadArray<DoubleArray>;
362
517
  getUvNorth(w: number, h: number, l: number): QuadArray<DoubleArray>;
363
518
  getFaceUv(face: CubeFace, w: number, h: number, l: number): QuadArray<DoubleArray>;
364
- toUvArray(w: number, h: number, l: number): number[];
519
+ toUvArray(w: number, h: number, l: number, mirror?: boolean): number[];
365
520
  }
366
521
 
367
522
  interface MinecraftTextureMeta extends MinecraftAsset {
368
- animation: AnimationMeta;
523
+ animation?: AnimationMeta;
524
+ gui?: {
525
+ scaling?: GuiSpriteScaling;
526
+ };
369
527
  }
528
+ type GuiSpriteScaling = {
529
+ type: "stretch";
530
+ } | {
531
+ type: "tile";
532
+ width: number;
533
+ height: number;
534
+ } | {
535
+ type: "nine_slice";
536
+ width: number;
537
+ height: number;
538
+ border: number | {
539
+ left: number;
540
+ top: number;
541
+ right: number;
542
+ bottom: number;
543
+ };
544
+ stretch_inner?: boolean;
545
+ };
370
546
  interface AnimationMeta {
371
547
  interpolate: boolean;
372
548
  width: number;
@@ -489,6 +665,7 @@ declare class TextureAtlas implements Disposable {
489
665
  };
490
666
  readonly hasTransparency: boolean;
491
667
  ticker?: number;
668
+ private readonly subscribers;
492
669
  constructor(model: Model, image: CanvasImage, sizes: {
493
670
  [texture: string]: DoubleArray;
494
671
  }, positions: {
@@ -496,6 +673,8 @@ declare class TextureAtlas implements Disposable {
496
673
  }, hasAnimation: boolean, animatorFunctions: {
497
674
  [p: string]: AnimatorFunction;
498
675
  }, hasTransparency: boolean);
676
+ /** Calls subscribers when an animation frame changes; unused atlases do not tick. */
677
+ subscribe(callback: () => void): () => void;
499
678
  getData(texture: string): ImageData$1;
500
679
  dispose(): void;
501
680
  }
@@ -514,6 +693,7 @@ declare class UVMapper {
514
693
  static setCubeUvs(geometry: BoxGeometry, originalTextureSize: DoubleArray, actualTextureSize: DoubleArray, faces: ModelFaces): void;
515
694
  static facesToUvArray(faces: ModelFaces, originalTextureSize: DoubleArray, actualTextureSize: DoubleArray): number[];
516
695
  static facesToUv(faces: ModelFaces, originalTextureSize: DoubleArray, actualTextureSize: DoubleArray): Float32BufferAttribute;
696
+ static lockUvs(geometry: BoxGeometry, faces: ModelFaces, atlas: TextureAtlas, rotation: Euler): void;
517
697
  static getAtlas(model: Model): Promise<Maybe<TextureAtlas>>;
518
698
  static fillMissingTextureKeys<T>(textures: ModelTextures, target: {
519
699
  [k: string]: T;
@@ -540,8 +720,8 @@ declare class MinecraftFaceUV {
540
720
  * Idle Node processes can exit without calling this: cache and Ticker timers are unref'd,
541
721
  * and idle request queues hold no timer. Pending requests keep their normal timer references.
542
722
  *
543
- * Call this only when finished with MineRender. Waiting and future requests reject; requests
544
- * already running can finish. Queue shutdown is permanent, and cache expiry timers do not restart.
723
+ * Call this only when finished with MineRender. Queued, retrying, and future requests reject;
724
+ * HTTP requests already running can finish. Queue shutdown is permanent, and cache expiry timers do not restart.
545
725
  */
546
726
  declare function shutdown(): void;
547
727
 
@@ -549,46 +729,19 @@ declare class BatchedExecutor {
549
729
  readonly interval: number;
550
730
  readonly batch: number;
551
731
  private readonly queue;
552
- private readonly task;
553
732
  constructor(interval?: number, batch?: number);
554
- submit(task: Task): void;
555
- private run;
556
- private runNext;
733
+ submit<T>(task: Task<T>): Promise<T>;
734
+ stop(): void;
557
735
  }
558
- type Task = () => any | Promise<any>;
736
+ type Task<T = unknown> = () => T | Promise<T>;
559
737
 
560
738
  declare function prefix(prefix?: string): string;
561
739
 
562
- interface ModelPart {
563
- textureWidth: number;
564
- textureHeight: number;
565
- textureOffsetU: number;
566
- textureOffsetV: number;
567
- pivotX: number;
568
- pivotY: number;
569
- pivotZ: number;
570
- pitch: number;
571
- yaw: number;
572
- roll: number;
573
- mirror: boolean;
574
- cubes: Cube[];
575
- children: ModelPart[];
576
- }
577
- interface Cube {
578
- minX: number;
579
- minY: number;
580
- minZ: number;
581
- maxX: number;
582
- maxY: number;
583
- maxZ: number;
584
- }
585
-
586
740
  declare function applyElementRotation(rotation: ElementRotation, geometry: BufferGeometry): void;
587
- declare function applyModelPartRotation(modelPart: ModelPart, geometry: BufferGeometry): void;
588
741
  declare function applyGenericRotation(axis: Axis, rotation: number, obj: Object3D): void;
589
742
  declare function addBox3WireframeToObject(box: Box3, obj: Object3D, color?: number, w?: number): void;
590
743
  declare function addWireframeToObject(obj: Object3D, color?: number, w?: number): void;
591
- declare function addWireframeToMesh(geo: BufferGeometry, mesh: Mesh, color?: number, w?: number): void;
744
+ declare function addWireframeToMesh(geo: BufferGeometry, mesh: Mesh, color?: number, w?: number): () => void;
592
745
 
593
746
  declare function captureException(e: any, ...extra: any[]): void;
594
747
  declare function timingStart(marker: string): void;
@@ -613,16 +766,47 @@ declare enum AssetParser {
613
766
  declare abstract class AssetSource {
614
767
  protected constructor();
615
768
  abstract get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
769
+ /**
770
+ * Identifies this source's content across sessions for persistent caching. Sources that
771
+ * cannot tell whether their content changed (an unnamed archive, for example) return
772
+ * undefined, which keeps their results out of long-lived caches.
773
+ */
774
+ get cacheId(): Maybe<string>;
775
+ }
776
+ /** A source failed to load or parse an asset; cause retains the original failure. */
777
+ declare class AssetLoadError extends Error {
778
+ readonly source: AssetSource;
779
+ readonly key: AssetKey;
780
+ readonly path: string;
781
+ readonly cause: unknown;
782
+ constructor(source: AssetSource, key: AssetKey, path: string, cause: unknown);
616
783
  }
617
784
 
618
785
  declare class AssetLoader {
619
786
  static ROOT: string;
620
787
  private static _SOURCES;
788
+ /** Used when a registered source cannot identify its content, so nothing persists past this session. */
789
+ private static readonly SESSION_SCOPE;
790
+ static get version(): string;
791
+ static setVersion(version: string): void;
792
+ /**
793
+ * Scope for persistent cache keys. Empty with only the default vanilla sources, so their
794
+ * entries stay valid across sessions; otherwise it names every added source (resource packs,
795
+ * mirrors) so their results never masquerade as vanilla assets after a reload.
796
+ */
797
+ static get persistentScope(): string;
798
+ /** Prefixes a persistent cache key with the current source scope. */
799
+ static persistentKey(key: string): string;
621
800
  static addSource(key: string, source: AssetSource, override?: boolean): void;
622
801
  static removeSource(key: string): Maybe<AssetSource>;
623
802
  static getAll<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<T[]>;
624
803
  /** Returns the first defined result in source-priority order, without merging assets. */
625
804
  static get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
805
+ /** Tries each path within a source before considering lower-priority sources. */
806
+ static getFirst<T extends MinecraftAsset>(keys: readonly AssetKey[], parser: AssetParser | string): Promise<Maybe<{
807
+ key: AssetKey;
808
+ asset: T;
809
+ }>>;
626
810
  }
627
811
 
628
812
  interface BlockState extends MinecraftAsset {
@@ -637,18 +821,19 @@ interface BlockStateVariant {
637
821
  y?: number;
638
822
  x?: number;
639
823
  uvlock?: boolean;
824
+ weight?: number;
640
825
  }
641
826
  interface BlockStateMultipart {
642
- when?: MultipartCondition | {
643
- OR: MultipartCondition[];
644
- };
645
- apply?: BlockStateVariant;
646
- }
647
- interface MultipartCondition {
648
- [key: string]: string;
827
+ when?: MultipartCondition;
828
+ apply?: BlockStateVariant | BlockStateVariant[];
649
829
  }
830
+ type MultipartCondition = Record<string, string> | {
831
+ OR: MultipartCondition[];
832
+ } | {
833
+ AND: MultipartCondition[];
834
+ };
650
835
 
651
- declare const DEFAULT_ROOT = "https://assets.mcasset.cloud/1.17.1";
836
+ declare const DEFAULT_ROOT = "https://assets.mcasset.cloud/1.21.11";
652
837
  declare const DEFAULT_NAMESPACE = "minecraft";
653
838
  declare class Assets {
654
839
  /**
@@ -673,6 +858,55 @@ type BlockStateProperties = {
673
858
  [key: string]: string;
674
859
  };
675
860
 
861
+ /** One model drawn by a block-entity renderer. */
862
+ interface BlockEntityPart {
863
+ model: string;
864
+ /** Model layer; defaults to "main". */
865
+ layer?: string;
866
+ /** Set only when the texture differs from the layer's default. */
867
+ textureLocation?: string;
868
+ /** Blockstate multipart syntax: every property must match, and "a|b" matches either value. */
869
+ when?: Record<string, string>;
870
+ }
871
+ /** Degrees per property value, or degrees per unit of a numeric property. */
872
+ type BlockEntityRotation = {
873
+ property: string;
874
+ degrees: Record<string, number>;
875
+ } | {
876
+ property: string;
877
+ step: number;
878
+ };
879
+ interface BlockEntityEntry {
880
+ parts: BlockEntityPart[];
881
+ rotation?: BlockEntityRotation;
882
+ /** Offset in model units, applied before the rotation. */
883
+ translation?: TripleArray;
884
+ }
885
+ /** The dataset's `blocks.json`: block ID to the models its block-entity renderer draws. */
886
+ type BlockEntityIndex = MinecraftAsset & {
887
+ [block: string]: BlockEntityEntry;
888
+ };
889
+ interface ResolvedBlockEntity {
890
+ parts: BlockEntityPart[];
891
+ /** Degrees counter-clockwise seen from above, about the block's vertical centre axis. */
892
+ rotation: number;
893
+ translation: TripleArray;
894
+ }
895
+ declare class BlockEntities {
896
+ /**
897
+ * Loads the block index of a version. Versions and sources without one yield an empty index, and so does
898
+ * a failed load: the index is optional, and blocks must not retry or fail with it one by one. The empty
899
+ * result is cached like any other; `Caching.clear()` or `AssetLoader.setVersion()` forces a new attempt.
900
+ */
901
+ static getIndex(root?: string): Promise<BlockEntityIndex>;
902
+ /** The index entry of a block ID such as `minecraft:chest`. */
903
+ static entry(index: BlockEntityIndex, block: string): Maybe<BlockEntityEntry>;
904
+ /** Selects the parts and placement for a block ID such as `minecraft:chest`; undefined when nothing is drawn. */
905
+ static resolve(index: BlockEntityIndex, block: string, state?: BlockStateProperties): Maybe<ResolvedBlockEntity>;
906
+ /** Placement in block space (0..16 per axis), applied on top of the model's own transform. */
907
+ static matrix(resolved: ResolvedBlockEntity, matrix?: Matrix4): Matrix4;
908
+ }
909
+
676
910
  declare class BlockStates {
677
911
  private static _persistentCache;
678
912
  private static get PERSISTENT_CACHE();
@@ -687,25 +921,95 @@ declare class DefaultBlockStates implements MinecraftAsset {
687
921
  [k: string]: BlockStatePropertyDefaults;
688
922
  }
689
923
 
690
- interface EntityModel extends BasicMinecraftAsset {
691
- parts?: {
692
- [p: string]: ModelPart;
693
- };
694
- }
924
+ /** `entity-models/animations/<namespace>/<model id>.json`: native and sampled vanilla animation clips. */
925
+ interface EntityAnimationFile extends MinecraftAsset {
926
+ id: string;
927
+ animations: Record<string, EntityAnimation>;
928
+ }
929
+ interface EntityAnimation {
930
+ /** Seconds. */
931
+ length: number;
932
+ loop: boolean;
933
+ /** Geometry layer targeted by this clip; defaults to `main`. */
934
+ layer?: string;
935
+ /** Part name anywhere in a layer; `root` is the layer's root part. */
936
+ bones: Record<string, EntityAnimationBone>;
937
+ }
938
+ type EntityAnimationChannel = "position" | "rotation" | "scale";
939
+ /** Keyframes in time order per channel. */
940
+ type EntityAnimationBone = Partial<Record<EntityAnimationChannel, EntityAnimationKeyframe[]>>;
941
+ interface EntityAnimationKeyframe {
942
+ /** Seconds. */
943
+ time: number;
944
+ /** Offset from the default pose: model units, radians, or scale minus one. */
945
+ value: TripleArray;
946
+ /** Value to arrive at when it differs from `value`; linear interpolation only. */
947
+ pre?: TripleArray;
948
+ /** Applies between the previous keyframe and this one. */
949
+ interpolation: "linear" | "catmullrom";
950
+ }
951
+ /** Sampled offsets from the default pose, per bone and channel. */
952
+ type EntityAnimationPose = Record<string, Partial<Record<EntityAnimationChannel, TripleArray>>>;
953
+ declare const ENTITY_ANIMATION_CHANNELS: readonly EntityAnimationChannel[];
954
+ /**
955
+ * Samples one channel like vanilla's `KeyframeAnimation.Entry`: the first value holds before the
956
+ * first keyframe and the last value after the last one; in between, the later keyframe selects the interpolation.
957
+ */
958
+ declare function sampleEntityKeyframes(keyframes: readonly EntityAnimationKeyframe[], time: number): TripleArray;
959
+ /** Elapsed seconds within the animation: modulo `length` when looping, as vanilla does. */
960
+ declare function entityAnimationTime(animation: EntityAnimation, time: number, loop?: boolean): number;
961
+ /** Samples every bone and channel of an animation at `time` seconds. */
962
+ declare function sampleEntityAnimation(animation: EntityAnimation, time: number, loop?: boolean): EntityAnimationPose;
695
963
 
696
964
  declare class Entities {
697
- static getBlockEntityModels(): Promise<Maybe<BlockEntityModels>>;
698
- static getEntityModels(): Promise<Maybe<EntityModels>>;
699
- static getBlockList(): Promise<string[]>;
700
965
  static getEntityList(): Promise<string[]>;
701
- static getBlock(modelKey: BasicAssetKey, textureKey?: BasicAssetKey): Promise<Maybe<EntityModel>>;
702
- static getEntity(modelKey: BasicAssetKey, textureKey?: BasicAssetKey): Promise<Maybe<EntityModel>>;
966
+ private static getModelFile;
967
+ static getLayerList(modelKey: BasicAssetKey): Promise<string[]>;
968
+ /** The dataset's extra draws on top of `main`; their `when` labels are the states `EntityModelOptions.when` can enable. */
969
+ static getPassList(modelKey: BasicAssetKey): Promise<EntityModelPass[]>;
970
+ static getEntity(modelKey: BasicAssetKey, textureKey?: BasicAssetKey, options?: EntityModelOptions): Promise<Maybe<EntityModel>>;
971
+ /**
972
+ * Native and sampled vanilla clips by name, or undefined when the model or selected version has none.
973
+ */
974
+ static getAnimations(modelKey: BasicAssetKey): Promise<Maybe<Record<string, EntityAnimation>>>;
975
+ static resolveTexture(modelKey: BasicAssetKey): Promise<Maybe<AssetKey>>;
976
+ /** @deprecated Use getEntityList(); block entities share the entity dataset. */
977
+ static getBlockList(): Promise<string[]>;
978
+ /** @deprecated Use getEntity(); block entities share the entity dataset. */
979
+ static getBlock(modelKey: BasicAssetKey, textureKey?: BasicAssetKey, options?: EntityModelOptions): Promise<Maybe<EntityModel>>;
980
+ }
981
+ interface EntityModelOptions {
982
+ layer?: string;
983
+ /** Layer names in draw order; an explicit selection draws exactly these layers and no dataset passes. */
984
+ layers?: string[];
985
+ /**
986
+ * Entity states that enable the dataset's conditional passes, e.g. `["powered"]` for a charged creeper.
987
+ * Without `layer`/`layers`, `main` and every unconditional pass are always drawn.
988
+ */
989
+ when?: string[];
990
+ /** Per-layer texture overrides, keyed like `EntityModel.layers`. The positional texture key applies to the first selected layer. */
991
+ textures?: Record<string, BasicAssetKey>;
703
992
  }
704
- declare class EntityModels implements MinecraftAsset {
705
- [k: string]: any;
993
+
994
+ interface BitmapGlyph {
995
+ image?: CompatCanvas;
996
+ /** Source rectangle in the bitmap sheet, before applying scale. */
997
+ x: number;
998
+ y: number;
999
+ width: number;
1000
+ height: number;
1001
+ scale: number;
1002
+ ascent: number;
1003
+ advance: number;
706
1004
  }
707
- declare class BlockEntityModels implements MinecraftAsset {
708
- [k: string]: any;
1005
+ interface BitmapFont {
1006
+ glyphs: Map<string, BitmapGlyph>;
1007
+ }
1008
+ declare class Fonts {
1009
+ static get(key?: AssetKey | string): Promise<BitmapFont>;
1010
+ private static relatedKey;
1011
+ private static load;
1012
+ private static bitmap;
709
1013
  }
710
1014
 
711
1015
  declare class Models {
@@ -713,15 +1017,40 @@ declare class Models {
713
1017
  private static get PERSISTENT_CACHE();
714
1018
  static getItemList(): Promise<string[]>;
715
1019
  static loadAndMerge(key: AssetKey): Promise<Maybe<Model>>;
1020
+ private static getItemModel;
1021
+ private static defaultItemModel;
716
1022
  static getRaw(key: AssetKey): Promise<Maybe<Model>>;
717
1023
  static getMerged(key: AssetKey): Promise<Maybe<Model>>;
718
1024
  static get(key: AssetKey): Promise<Maybe<Model>>;
719
1025
  static clearCache(): Promise<void>;
720
1026
  }
721
1027
 
1028
+ declare class DisplayTransforms {
1029
+ /** Resolve hand fallbacks within one model, before inheriting parent display entries. */
1030
+ static withHandFallbacks(display: Model["display"]): Model["display"];
1031
+ /** Build a display pose for geometry already centered at the model's [8, 8, 8] pivot. */
1032
+ static getMatrix(display: Model["display"], position: DisplayPosition): Matrix4;
1033
+ static apply(geometry: BufferGeometry, matrix: Matrix4): void;
1034
+ }
1035
+
1036
+ declare class ItemTints {
1037
+ /** Resolves preview colors from item definitions; explicit per-index colors take precedence. */
1038
+ static get(model: Model, tints?: Record<number, number>): Promise<Record<number, number> | undefined>;
1039
+ private static rgb;
1040
+ }
1041
+
1042
+ declare class ModelCulling {
1043
+ static toLocalMask(worldMask: number, rotation: Euler): number;
1044
+ static isOpaqueFullCube(atlas: Maybe<TextureAtlas>): boolean;
1045
+ }
1046
+
722
1047
  declare class ModelGenerator {
723
1048
  static readonly ITEM_LAYERS: string[];
724
- static generateItemModel(imageData: ImageData$1, layer: string): ModelElement[];
1049
+ /**
1050
+ * Front and back faces plus one zero-thickness side face per run of texels that border a transparent texel,
1051
+ * like vanilla's ItemModelGenerator. Pass the pixels of a single (first) animation frame.
1052
+ */
1053
+ static generateItemModel(imageData: Pick<ImageData$1, "width" | "height" | "data">, layer: string): ModelElement[];
725
1054
  }
726
1055
 
727
1056
  declare class ModelMerger {
@@ -729,16 +1058,44 @@ declare class ModelMerger {
729
1058
  protected static collectAllParents(model: Model): Promise<Model[]>;
730
1059
  }
731
1060
 
1061
+ interface SpecialItemPart {
1062
+ model: EntityModel;
1063
+ transform: Matrix4;
1064
+ rotations: Record<string, TripleArray>;
1065
+ }
1066
+ declare class SpecialItems {
1067
+ /** Resolves the static entity parts drawn by a special item renderer, in model units. */
1068
+ static getParts(special: SpecialItemRenderer, root?: string): Promise<SpecialItemPart[]>;
1069
+ /** An owned material with model-preview shading; its entity texture remains shared. */
1070
+ static createMaterial(source: MeshBasicMaterial, shade: boolean): MeshBasicMaterial;
1071
+ }
1072
+
732
1073
  interface Block {
733
1074
  type: string;
734
1075
  properties?: BlockStateProperties;
735
1076
  nbt?: any;
736
1077
  }
737
1078
 
1079
+ declare class BlockStateResolver {
1080
+ static defaults(blockState: BlockState): Promise<BlockStateProperties>;
1081
+ static select(blockState: BlockState, state: BlockStateProperties, choose?: (variants: BlockStateVariant | BlockStateVariant[]) => BlockStateVariant): BlockStateVariant[];
1082
+ static matching(blockState: BlockState, state: BlockStateProperties): (BlockStateVariant | BlockStateVariant[])[];
1083
+ static choose(variants: BlockStateVariant | BlockStateVariant[]): BlockStateVariant;
1084
+ static rotation(variant: BlockStateVariant): Euler;
1085
+ }
1086
+
1087
+ declare class BlockTints {
1088
+ /** Resolves block preview colors without biome context; explicit tints take precedence. */
1089
+ static get(key: AssetKey | undefined, state: BlockStateProperties, model: Model, tints?: Record<number, number>): Promise<Record<number, number> | undefined>;
1090
+ }
1091
+
738
1092
  interface Instanceable {
739
1093
  nextInstance(): InstanceReference<SceneObject>;
1094
+ removeInstanceAt(index: number): void;
1095
+ isInstanceActive(index: number, reference: InstanceReference<Instanceable>): boolean;
740
1096
  getMatrixAt(index: number, matrix?: Matrix4): Matrix4;
741
1097
  setMatrixAt(index: number, matrix: Matrix4): void;
1098
+ setInstanceVisibleAt(index: number, visible: boolean): void;
742
1099
  setPositionRotationScaleAt(index: number, position?: Vector3, rotation?: Euler, scale?: Vector3): void;
743
1100
  setPositionAt(index: number, position: Vector3): void;
744
1101
  getPositionAt(index: number, vector?: Vector3): Vector3;
@@ -749,14 +1106,18 @@ interface Instanceable {
749
1106
  }
750
1107
  declare function isInstanceable(obj: any): obj is Instanceable;
751
1108
 
752
- declare class InstanceReference<T extends Instanceable> implements Transformable {
1109
+ declare class InstanceReference<T extends Instanceable> implements Transformable, Disposable {
753
1110
  readonly instanceable: T;
754
1111
  readonly index: number;
755
1112
  readonly isInstanceReference: true;
756
1113
  constructor(instanceable: T, index: number);
757
1114
  nextInstance(): InstanceReference<SceneObject>;
1115
+ private get activeInstanceable();
1116
+ removeFromScene(): void;
1117
+ dispose(): void;
758
1118
  getMatrix(matrix?: Matrix4): Matrix4;
759
1119
  setMatrix(matrix: Matrix4): void;
1120
+ setVisible(visible: boolean): void;
760
1121
  setPositionRotationScale(position?: Vector3, rotation?: Euler, scale?: Vector3): void;
761
1122
  setPosition(position: Vector3): void;
762
1123
  getPosition(): Vector3;
@@ -779,18 +1140,34 @@ declare class ModelObject extends SceneObject {
779
1140
  readonly isModelObject: true;
780
1141
  static readonly DEFAULT_OPTIONS: ModelObjectOptions;
781
1142
  readonly options: ModelObjectOptions;
782
- private atlas?;
1143
+ protected atlas?: TextureAtlas;
1144
+ private atlasMaterial?;
1145
+ private atlasTexture?;
1146
+ private unsubscribeAtlas?;
1147
+ private readonly specialMaterials;
783
1148
  blockParent: Maybe<BlockObject>;
784
1149
  private meshesCreated;
785
1150
  constructor(originalModel: Model, options?: Partial<ModelObjectOptions>);
786
1151
  init(): Promise<void>;
787
- dispose(): void;
788
1152
  get textureAtlas(): Maybe<TextureAtlas>;
1153
+ get isOpaqueFullCube(): boolean;
789
1154
  protected loadTextures(): Promise<void>;
790
1155
  protected createMeshes(force?: boolean): void;
791
1156
  protected applyTextures(): void;
1157
+ private updateAnimationSubscription;
1158
+ nextInstance(): InstanceReference<SceneObject>;
1159
+ removeInstanceAt(index: number): void;
1160
+ disposeAndRemoveAllChildren(): void;
792
1161
  }
793
1162
  interface ModelObjectOptions extends SceneObjectOptions {
1163
+ /** Minecraft display pose applied around the model center, before scene transforms. */
1164
+ displayPosition?: DisplayPosition;
1165
+ /** Quarter-turn block rotation in radians to compensate when locking UVs. */
1166
+ uvLockRotation?: TripleArray;
1167
+ /** sRGB 0xRRGGBB colors by face tint index; omitted indices stay white. */
1168
+ tints?: Record<number, number>;
1169
+ /** Hidden neighbor directions in CUBE_FACES order, before the model's block rotation. */
1170
+ cullMask?: number;
794
1171
  }
795
1172
  declare function isModelObject(obj: any): obj is ModelObject;
796
1173
 
@@ -823,24 +1200,71 @@ declare enum SkinPart {
823
1200
  }
824
1201
  declare const SKIN_PARTS: SkinPart[];
825
1202
 
1203
+ type CapeLayout = "minecraft" | "optifine" | "labymod";
1204
+ declare const capeTextureSizes: Record<CapeLayout, DoubleArray>;
1205
+
1206
+ /** A player model facing +Z. Left and right parts are the player's own: left is +X, right is -X. */
826
1207
  declare class SkinObject extends SceneObject {
827
1208
  readonly options: SkinObjectOptions;
828
1209
  private slim;
829
- private legacy;
1210
+ private detectedSlim;
830
1211
  private skinTextureSrc?;
831
- private skinTextureWidth;
832
- private skinTextureHeight;
833
- private capeTextureSrc?;
1212
+ private skinMaterial?;
1213
+ private skinLoad;
1214
+ private capeLoad;
834
1215
  constructor(options?: DeepPartial<SkinObjectOptions>);
835
1216
  init(): Promise<void>;
836
1217
  protected removeMeshes(): void;
837
1218
  protected createMeshes(): void;
838
- setSkinTexture(src: string): void;
839
- setSlim(slim: boolean): void;
840
- setLegacy(legacy: boolean): void;
1219
+ setSkinTexture(src: string): Promise<void>;
1220
+ /** Load a cape texture in the selected layout, or pass undefined to remove the cape. */
1221
+ setCapeTexture(src?: string, layout?: CapeLayout): Promise<void>;
1222
+ /** Select the arm model, or pass undefined to use texture detection. */
1223
+ setSlim(slim?: boolean): void;
1224
+ private updateSlim;
1225
+ /** Select the texture layout, or pass undefined to detect it from image dimensions. */
1226
+ setLegacy(legacy?: boolean): Promise<void>;
1227
+ dispose(): void;
841
1228
  protected getBoxGeometry(part: SkinPart): BoxGeometry;
842
1229
  }
843
1230
  interface SkinObjectOptions extends SceneObjectOptions {
1231
+ slim?: boolean;
1232
+ legacy?: boolean;
1233
+ }
1234
+
1235
+ interface EntityAnimationOptions {
1236
+ /** Overrides the animation's own `loop` flag. */
1237
+ loop?: boolean;
1238
+ /** Playback rate applied to advanced time; defaults to 1. */
1239
+ speed?: number;
1240
+ /** Start time in seconds; defaults to 0. */
1241
+ time?: number;
1242
+ }
1243
+ /**
1244
+ * Poses part groups from a keyframe animation the way vanilla does: every update restores the
1245
+ * default pose of each animated part, then adds the sampled offsets to its position, Euler angles and scale.
1246
+ * It owns no timer; the owner advances it.
1247
+ */
1248
+ declare class EntityAnimationPlayer {
1249
+ private parts;
1250
+ private _animation?;
1251
+ private _time;
1252
+ private loop;
1253
+ private speed;
1254
+ get animation(): EntityAnimation | undefined;
1255
+ get time(): number;
1256
+ /**
1257
+ * Starts an animation on matching named parts. Supplied baked poses are the baseline for offsets;
1258
+ * without them, the current pose is used. Stopping restores the pose from before playback.
1259
+ */
1260
+ play(layers: Object3D[], animation: EntityAnimation, options?: EntityAnimationOptions, poses?: ReadonlyMap<Object3D, EntityModelPart["pose"]>): void;
1261
+ /** Restores the poses from before playback. Returns whether an animation was active. */
1262
+ stop(): boolean;
1263
+ /** Forgets the animation without touching the parts, for parts that no longer exist. */
1264
+ clear(): void;
1265
+ setTime(seconds: number): boolean;
1266
+ advance(deltaSeconds: number): boolean;
1267
+ private apply;
844
1268
  }
845
1269
 
846
1270
  declare class EntityObject extends SceneObject {
@@ -848,20 +1272,151 @@ declare class EntityObject extends SceneObject {
848
1272
  readonly isEntityObject: true;
849
1273
  static readonly DEFAULT_OPTIONS: EntityObjectOptions;
850
1274
  readonly options: EntityObjectOptions;
851
- private imageData?;
852
1275
  private meshesCreated;
1276
+ private readonly geometries;
1277
+ private readonly disposeWireframes;
1278
+ /** Scrolling materials are owned: their texture offset follows this entity's age. */
1279
+ private readonly scrollMaterials;
1280
+ private scrollTicker;
1281
+ /** Entity age in ticks, as vanilla's `ageInTicks`; drives the scrolling render modes. */
1282
+ age: number;
1283
+ private readonly animationPlayers;
1284
+ private readonly partPoses;
853
1285
  constructor(entity: EntityModel, options?: Partial<EntityObjectOptions>);
854
1286
  init(): Promise<void>;
855
1287
  dispose(): void;
856
- private get textureKey();
857
- protected loadTextures(): Promise<void>;
1288
+ disposeAndRemoveAllChildren(): void;
1289
+ private clearScrollMaterials;
1290
+ private updateScrollSubscription;
1291
+ /** Applies the entity age to the scrolling materials; the ticker calls this 20 times per second. */
1292
+ private updateScroll;
1293
+ /** The first active clip, until playback is stopped or the object is disposed. */
1294
+ get animation(): Maybe<EntityAnimation>;
1295
+ /** Clips playing together, each targeting a separate geometry layer. */
1296
+ get activeAnimations(): readonly EntityAnimation[];
1297
+ /** Seconds since the animation started, before looping. */
1298
+ get animationTime(): number;
1299
+ /**
1300
+ * Plays a clip from {@link Entities.getAnimations}, replacing all active clips.
1301
+ * Offsets apply to the baked pose in the clip's layer (`main` by default), including repeated draws of that layer.
1302
+ * The object owns no clock: call {@link advanceAnimation} per frame, or {@link setAnimationTime}.
1303
+ */
1304
+ playAnimation(animation: EntityAnimation, options?: EntityAnimationOptions): void;
1305
+ /** Plays one clip per selected geometry layer, with a shared clock and no blending between clips. */
1306
+ playAnimations(animations: readonly EntityAnimation[], options?: EntityAnimationOptions): void;
1307
+ /** Stops all clips and restores the poses from before playback. */
1308
+ stopAnimation(): void;
1309
+ /** Poses the object at an explicit time in seconds. Has no effect without an animation. */
1310
+ setAnimationTime(seconds: number): void;
1311
+ /** Advances the animation by a frame delta in seconds, scaled by its speed. Has no effect without an animation. */
1312
+ advanceAnimation(deltaSeconds: number): void;
1313
+ getLayerGroup(name: string): Maybe<Object3D>;
1314
+ getGroupByName(name: string, layerName?: string): Maybe<Object3D>;
1315
+ getMeshByName(name: string, layerName?: string): Maybe<Mesh>;
1316
+ private get entityLayers();
1317
+ private getTextureKey;
1318
+ protected loadTextures(layer?: EntityLayer): Promise<Maybe<ExtractableImageData>>;
858
1319
  protected createMeshes(force?: boolean): void;
1320
+ private createPart;
859
1321
  protected applyTextures(): Promise<void>;
860
1322
  }
861
1323
  interface EntityObjectOptions extends SceneObjectOptions {
1324
+ /**
1325
+ * `true` applies only vanilla's entity flip, scale (-1, -1, 1); `false` keeps raw model space.
1326
+ * By default the model's dataset transform is used, or the flip for models without one.
1327
+ */
1328
+ flip?: boolean;
1329
+ /** Colours for the dataset's tint labels, e.g. `{ wool_color: 0xf9801d }`; a pass whose label is absent stays untinted. */
1330
+ tints?: Record<string, ColorRepresentation>;
862
1331
  }
863
1332
  declare function isEntityObject(obj: any): obj is EntityObject;
864
1333
 
1334
+ interface GuiTextStyle {
1335
+ /** sRGB 0xRRGGBB; defaults to white. */
1336
+ color?: number;
1337
+ bold?: boolean;
1338
+ italic?: boolean;
1339
+ }
1340
+ interface GuiTextRun extends GuiTextStyle {
1341
+ text: string;
1342
+ }
1343
+ /** Literal text, or styled runs. Newlines are preserved. */
1344
+ type GuiText = string | readonly GuiTextRun[];
1345
+ interface GuiTextOptions extends GuiTextStyle {
1346
+ /** Font resource ID; defaults to minecraft:default. */
1347
+ font?: AssetKey | string;
1348
+ /** Draws a one-pixel shadow; defaults to true. */
1349
+ shadow?: boolean;
1350
+ /** Wrap width in GUI pixels. Long words break at glyph boundaries. */
1351
+ maxWidth?: number;
1352
+ /** Distance between line origins; defaults to 9 GUI pixels. */
1353
+ lineHeight?: number;
1354
+ }
1355
+ interface PositionedGuiGlyph {
1356
+ character: string;
1357
+ glyph?: BitmapGlyph;
1358
+ x: number;
1359
+ y: number;
1360
+ advance: number;
1361
+ style: Required<GuiTextStyle>;
1362
+ }
1363
+ interface GuiTextLayout {
1364
+ glyphs: PositionedGuiGlyph[];
1365
+ lineWidths: number[];
1366
+ width: number;
1367
+ height: number;
1368
+ }
1369
+ /** Measures and wraps text using the same glyph advances used for rendering. */
1370
+ declare function layoutGuiText(text: GuiText, options?: GuiTextOptions): Promise<GuiTextLayout>;
1371
+ /** Creates glyph batches in painter order. Unsupported characters use an outlined missing glyph. */
1372
+ declare function createGuiTextGeometry(layout: GuiTextLayout, shadow?: boolean): {
1373
+ image?: CompatCanvas;
1374
+ geometry: BufferGeometry;
1375
+ }[];
1376
+
1377
+ /** GUI layers use pixel coordinates. Later layers draw above earlier layers. */
1378
+ type GuiLayer = GuiTextureLayer | GuiItemLayer | GuiTextLayer;
1379
+ interface GuiLayerLayout {
1380
+ name?: string;
1381
+ /** Top-left position; x grows right and y grows down. Defaults to [0, 0]. */
1382
+ position?: [number, number];
1383
+ /** Output size; defaults to native texture/text dimensions, and [16, 16] for items. */
1384
+ size?: [number, number];
1385
+ }
1386
+ interface GuiTextureLayer extends GuiLayerLayout {
1387
+ texture: AssetKey | string;
1388
+ /** Source-image pixels: [x, y, width, height], measured from the top left. Crops ignore sprite scaling. */
1389
+ crop?: [number, number, number, number];
1390
+ }
1391
+ interface GuiItemLayer extends GuiLayerLayout {
1392
+ /** Model key, such as minecraft:item/stone; uses the model's GUI display pose. */
1393
+ item: AssetKey | string;
1394
+ /** sRGB 0xRRGGBB colors by face tint index; omitted indices stay white. */
1395
+ tints?: Record<number, number>;
1396
+ }
1397
+ interface GuiTextLayer extends GuiLayerLayout, GuiTextOptions {
1398
+ text: GuiText;
1399
+ }
1400
+
1401
+ declare class GuiObject extends SceneObject {
1402
+ readonly textureLayers: readonly GuiLayer[];
1403
+ readonly isGuiObject: true;
1404
+ /** Local bounds in GUI pixels, with y growing down from the origin. */
1405
+ readonly bounds: Box2;
1406
+ private readonly geometries;
1407
+ private readonly ownedMaterials;
1408
+ private readonly textMaterials;
1409
+ private initialized;
1410
+ constructor(textureLayers: readonly GuiLayer[], options?: Partial<GuiObjectOptions>);
1411
+ init(): Promise<void>;
1412
+ private createItem;
1413
+ private loadMaterial;
1414
+ disposeAndRemoveAllChildren(): void;
1415
+ }
1416
+ interface GuiObjectOptions extends SceneObjectOptions {
1417
+ }
1418
+ declare function isGuiObject(obj: any): obj is GuiObject;
1419
+
865
1420
  declare class MineRenderScene extends Scene {
866
1421
  readonly isMineRenderScene: true;
867
1422
  static readonly DEFAULT_OPTIONS: MineRenderSceneOptions;
@@ -881,6 +1436,7 @@ declare class MineRenderScene extends Scene {
881
1436
  addBlock(blockState: BlockState, options?: Partial<BlockObjectOptions>, parent?: Object3D): Promise<BlockObject | InstanceReference<BlockObject>>;
882
1437
  addSkin(skin?: string, options?: Partial<SkinObjectOptions>, parent?: Object3D): Promise<SkinObject>;
883
1438
  addEntity(entity: EntityModel, options?: Partial<EntityObjectOptions>, parent?: Object3D): Promise<EntityObject | InstanceReference<EntityObject>>;
1439
+ addGui(layers: readonly GuiLayer[], options?: Partial<GuiObjectOptions>, parent?: Object3D): Promise<GuiObject>;
884
1440
  }
885
1441
  interface MineRenderSceneOptions {
886
1442
  }
@@ -896,6 +1452,10 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
896
1452
  private materialCallbacks;
897
1453
  protected _isInstanced: boolean;
898
1454
  _instanceCounter: number;
1455
+ protected instanceMesh?: InstancedMesh;
1456
+ private readonly instanceReferences;
1457
+ private readonly freeInstanceIndices;
1458
+ private readonly hiddenInstanceMatrices;
899
1459
  constructor(options?: Partial<SceneObjectOptions>);
900
1460
  set scene(scene: MineRenderScene);
901
1461
  get scene(): MineRenderScene;
@@ -935,8 +1495,15 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
935
1495
  get instanceCounter(): number;
936
1496
  protected constructInstanceReference(i: number): InstanceReference<SceneObject>;
937
1497
  nextInstance(): InstanceReference<SceneObject>;
1498
+ /** Returns the live reference for a raycast hit on this object's instance mesh. */
1499
+ getInstanceReference(mesh: Object3D, index: number): Maybe<InstanceReference<SceneObject>>;
1500
+ isInstanceActive(index: number, reference: InstanceReference<Instanceable>): boolean;
1501
+ removeInstanceAt(index: number): void;
1502
+ private growInstances;
1503
+ protected activeInstanceIndices(): Iterable<number>;
938
1504
  getMatrixAt(index: number, matrix?: Matrix4): Matrix4;
939
1505
  setMatrixAt(index: number, matrix: Matrix4): void;
1506
+ setInstanceVisibleAt(index: number, visible: boolean): void;
940
1507
  setPositionRotationScaleAt(index: number, position?: Vector3, rotation?: Euler, scale?: Vector3): void;
941
1508
  setPositionAt(index: number, position: Vector3): void;
942
1509
  getPositionAt(index: number, vector?: Vector3): Vector3;
@@ -958,6 +1525,23 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
958
1525
  }
959
1526
  declare function isSceneObject(obj: any): obj is SceneObject;
960
1527
 
1528
+ type FluidKind = "water" | "lava";
1529
+ interface BlockFluidState {
1530
+ kind: FluidKind;
1531
+ level: number;
1532
+ renderModel: boolean;
1533
+ }
1534
+ declare function getBlockFluidState(key?: AssetKey, state?: BlockStateProperties): BlockFluidState | undefined;
1535
+ declare function getFluidKind(key?: AssetKey, state?: BlockStateProperties): FluidKind | undefined;
1536
+ interface FluidSample {
1537
+ fluid?: FluidKind;
1538
+ level?: number;
1539
+ solid?: boolean;
1540
+ }
1541
+ type FluidSampler = (x: number, y: number, z: number) => FluidSample;
1542
+ /** Builds centered fluid faces with material groups 0 (still) and 1 (flowing). */
1543
+ declare function createFluidGeometry(kind: FluidKind, sample: FluidSampler): BufferGeometry;
1544
+
961
1545
  declare class BlockObject extends SceneObject {
962
1546
  readonly blockState: BlockState;
963
1547
  readonly isBlockObject: true;
@@ -971,16 +1555,45 @@ declare class BlockObject extends SceneObject {
971
1555
  private _instanceModel;
972
1556
  private _variants;
973
1557
  private _models;
1558
+ private _cullMask;
1559
+ private _fluidKey?;
1560
+ private _fluidSampler?;
1561
+ private _fluidModel?;
1562
+ private _entities;
1563
+ private _entityPlacement;
1564
+ private _entityGeneration;
974
1565
  constructor(blockState: BlockState, options?: Partial<BlockObjectOptions>);
975
1566
  init(): Promise<void>;
976
1567
  dispose(): void;
977
1568
  removeFromScene(): void;
1569
+ private clearModels;
1570
+ private removeModels;
1571
+ private removeEntities;
1572
+ /** Entity models drawn for this block instead of its block model; they are scene children, unlike the block. */
1573
+ get blockEntities(): readonly EntityObject[];
1574
+ /** Sets visibility for this block's model instances and block entities. */
1575
+ setVisible(visible: boolean): void;
1576
+ /**
1577
+ * Draws the block through the dataset's block-entity index. Returns false, leaving nothing behind,
1578
+ * when the block is not listed or one of its models cannot be loaded.
1579
+ */
1580
+ private createBlockEntities;
1581
+ private placeEntities;
1582
+ get isOccluding(): boolean;
1583
+ private getModelMatrix;
1584
+ private getModelCullMask;
1585
+ setCullMask(worldMask: number): Promise<void>;
978
1586
  get state(): {
979
1587
  [key: string]: string;
980
1588
  };
1589
+ get fluidKind(): FluidKind | undefined;
1590
+ get fluidLevel(): number;
1591
+ /** Refreshes fluid surfaces from relative neighbors; standalone previews use air around the block. */
1592
+ updateFluid(sample?: FluidSampler): Promise<void>;
981
1593
  nextInstance(): InstanceReference<SceneObject>;
982
1594
  protected mapStateToVariant(state: BlockStateProperties): Promise<BlockStateVariant[]>;
983
1595
  recreateModels(): Promise<void>;
1596
+ private hasGeometry;
984
1597
  protected getSingleVariant(variants: BlockStateVariant | BlockStateVariant[]): BlockStateVariant;
985
1598
  protected createAVariant(variants: BlockStateVariant | BlockStateVariant[], instanceInfo: Matrix4[]): Promise<void>;
986
1599
  protected createVariant(variant: BlockStateVariant): Promise<ModelObject | InstanceReference<ModelObject>>;
@@ -996,26 +1609,54 @@ declare class BlockObject extends SceneObject {
996
1609
  }
997
1610
  interface BlockObjectOptions extends ModelObjectOptions {
998
1611
  applyDefaultState: boolean;
1612
+ /** Properties applied before model creation, overriding defaults when applyDefaultState is enabled. */
1613
+ initialState?: BlockStateProperties;
999
1614
  }
1000
1615
  declare function isBlockObject(obj: any): obj is BlockObject;
1001
1616
 
1617
+ /** Saved fluid levels and solid neighbors determine the geometry shared by an instance pool. */
1618
+ declare function sampleFluid(kind: FluidKind, sample: FluidSampler): {
1619
+ key: string;
1620
+ sample: FluidSampler;
1621
+ };
1622
+ declare class FluidModelObject extends ModelObject {
1623
+ readonly kind: FluidKind;
1624
+ private readonly sample;
1625
+ private geometry?;
1626
+ constructor(kind: FluidKind, sample: FluidSampler, origin?: AssetKey, options?: Partial<ModelObjectOptions>);
1627
+ protected createMeshes(): void;
1628
+ protected applyTextures(): void;
1629
+ disposeAndRemoveAllChildren(): void;
1630
+ }
1631
+
1002
1632
  interface MultiBlockStructure {
1003
1633
  readonly size: TripleArray;
1004
1634
  readonly blocks: MultiBlockBlock[];
1635
+ readonly dataVersion?: number;
1636
+ readonly entities?: MultiBlockEntity[];
1637
+ }
1638
+ interface MultiBlockEntity {
1639
+ position: TripleArray;
1640
+ blockPosition?: TripleArray;
1641
+ nbt: unknown;
1005
1642
  }
1006
1643
  interface MultiBlockBlock extends Block {
1007
1644
  position: TripleArray;
1008
1645
  }
1009
1646
 
1010
1647
  declare class SchematicParser {
1011
- static parse(): Promise<MultiBlockStructure>;
1648
+ /**
1649
+ * Parses a legacy schematic using custom mappings before the bundled defaults.
1650
+ * Keys are `id:metadata`; values are block states such as `minecraft:oak_log[axis=x]`.
1651
+ */
1652
+ static parse(nbt: NBT, customMappings?: Readonly<Record<string, string>>): Promise<MultiBlockStructure>;
1012
1653
  }
1013
1654
 
1014
1655
  declare class StructureParser {
1015
1656
  static parse(_nbt: NBT, paletteIndex?: number): Promise<MultiBlockStructure>;
1016
1657
  }
1017
1658
  interface StructureNBT {
1018
- DataVersion: {
1659
+ DataVersion?: {
1019
1660
  type: "int";
1020
1661
  value: number;
1021
1662
  };
@@ -1027,7 +1668,13 @@ interface StructureNBT {
1027
1668
  };
1028
1669
  };
1029
1670
  palette?: Palette;
1030
- palettes?: Palette[];
1671
+ palettes?: {
1672
+ type: "list";
1673
+ value: {
1674
+ type: "list";
1675
+ value: Palette["value"][];
1676
+ };
1677
+ };
1031
1678
  blocks: {
1032
1679
  type: "list";
1033
1680
  value: {
@@ -1035,7 +1682,32 @@ interface StructureNBT {
1035
1682
  value: BlockEntry[];
1036
1683
  };
1037
1684
  };
1038
- entities: {};
1685
+ entities?: {
1686
+ type: "list";
1687
+ value: {
1688
+ type: "compound";
1689
+ value: {
1690
+ pos: {
1691
+ type: "list";
1692
+ value: {
1693
+ type: "double";
1694
+ value: TripleArray;
1695
+ };
1696
+ };
1697
+ blockPos: {
1698
+ type: "list";
1699
+ value: {
1700
+ type: "int";
1701
+ value: TripleArray;
1702
+ };
1703
+ };
1704
+ nbt: {
1705
+ type: "compound";
1706
+ value: any;
1707
+ };
1708
+ }[];
1709
+ };
1710
+ };
1039
1711
  }
1040
1712
  interface Palette {
1041
1713
  type: "list";
@@ -1079,14 +1751,17 @@ interface BlockEntry {
1079
1751
  }
1080
1752
 
1081
1753
  declare class NBTHelper {
1082
- static fromBuffer(buffer: Buffer): Promise<NBTAsset>;
1754
+ static fromBuffer(data: Uint8Array | ArrayBuffer, format?: NBTFormat): Promise<NBTAsset>;
1083
1755
  }
1084
1756
  interface NBTAsset extends MinecraftAsset, NBT {
1757
+ format?: NBTFormat;
1758
+ metadata?: Metadata;
1759
+ compression?: "gzip" | "none";
1085
1760
  }
1086
1761
 
1087
1762
  interface ResponseParser<T extends MinecraftAsset> {
1088
- config(request: AxiosRequestConfig): any;
1089
- parse(response: AxiosResponse): Maybe<T> | Promise<Maybe<T>>;
1763
+ config(request: RequestConfig): any;
1764
+ parse(response: RequestResponse): Maybe<T> | Promise<Maybe<T>>;
1090
1765
  }
1091
1766
 
1092
1767
  declare class HostedAssetSource extends AssetSource {
@@ -1105,6 +1780,7 @@ declare class HostedAssetSource extends AssetSource {
1105
1780
  private readonly _options;
1106
1781
  constructor(root: string, options?: Partial<HostedAssetSourceOptions>);
1107
1782
  get root(): string;
1783
+ get cacheId(): string;
1108
1784
  get options(): HostedAssetSourceOptions;
1109
1785
  get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser): Promise<Maybe<T>>;
1110
1786
  }
@@ -1119,6 +1795,8 @@ interface ArchiveEntry {
1119
1795
  }
1120
1796
 
1121
1797
  interface ArchiveProxy {
1798
+ /** Identifies the archive's content across sessions; undefined when it cannot be identified. */
1799
+ readonly id?: string;
1122
1800
  getEntries(): Promise<ArchiveEntry[]>;
1123
1801
  }
1124
1802
 
@@ -1126,6 +1804,7 @@ declare class ArchiveAssetSource extends AssetSource implements ArchiveProxy {
1126
1804
  readonly _archiveProxy: ArchiveProxy;
1127
1805
  constructor(archiveProxy: ArchiveProxy);
1128
1806
  static blob(blob: Blob): ArchiveAssetSource;
1807
+ get cacheId(): Maybe<string>;
1129
1808
  getEntries(): Promise<ArchiveEntry[]>;
1130
1809
  getEntry(path: string): Promise<Maybe<ArchiveEntry>>;
1131
1810
  get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
@@ -1136,7 +1815,8 @@ declare class ArchiveAssetSource extends AssetSource implements ArchiveProxy {
1136
1815
  declare class BrowserArchiveProxy implements ArchiveProxy {
1137
1816
  readonly _blob: Blob;
1138
1817
  readonly _reader: ZipReader<Blob>;
1139
- constructor(blob: Blob);
1818
+ readonly id?: string;
1819
+ constructor(blob: Blob, id?: string);
1140
1820
  getEntries(): Promise<ArchiveEntry[]>;
1141
1821
  }
1142
1822
 
@@ -1216,7 +1896,12 @@ declare class Caching {
1216
1896
  static readonly blockStateCache: AsyncLoadingCache<CacheKey, BlockState>;
1217
1897
  static readonly listAssetCache: AsyncLoadingCache<CacheKey, ListAsset>;
1218
1898
  static readonly defaultBlockStatesCache: AsyncLoadingCache<CacheKey, DefaultBlockStates>;
1219
- static readonly entityModelsCache: AsyncLoadingCache<CacheKey, EntityModels>;
1899
+ static readonly blockTintCache: AsyncLoadingCache<CacheKey, number>;
1900
+ static readonly entityModelCache: AsyncLoadingCache<CacheKey, EntityModelFile>;
1901
+ static readonly entityTextureCache: AsyncLoadingCache<CacheKey, AssetKey>;
1902
+ static readonly entityAnimationCache: AsyncLoadingCache<CacheKey, EntityAnimationFile>;
1903
+ static readonly blockEntityIndexCache: AsyncLoadingCache<CacheKey, BlockEntityIndex>;
1904
+ static readonly fontCache: AsyncLoadingCache<CacheKey, BitmapFont>;
1220
1905
  private static createAssetCache;
1221
1906
  /** Every cache above, so clear()/end() can never fall out of sync with the field list again. */
1222
1907
  private static get all();
@@ -1231,16 +1916,76 @@ declare class Caching {
1231
1916
  static get cacheSizes(): {};
1232
1917
  }
1233
1918
 
1919
+ /** Copies the nontransparent bounds without resizing the source; empty images become one transparent pixel. */
1920
+ declare function trimCanvas(source: CompatCanvas): CompatCanvas;
1921
+
1234
1922
  declare class MineRenderError extends Error {
1235
1923
  constructor(msg: any);
1236
1924
  get name(): string;
1237
1925
  }
1238
1926
 
1239
- declare class GuiObject extends SceneObject {
1927
+ interface SceneGLTFExportOptions {
1928
+ /** Returns a GLB ArrayBuffer instead of a glTF object. */
1929
+ binary?: boolean;
1930
+ /** Maximum width and height of each exported texture, in pixels. */
1931
+ maxTextureSize?: number;
1240
1932
  }
1241
- interface GuiObjectOptions extends SceneObjectOptions {
1933
+ /** Exports the visible meshes at their current poses without changing the source scene. */
1934
+ declare class SceneExporter {
1935
+ /** Returns OBJ geometry with normals and UVs; material files and textures are not included. */
1936
+ static toObj(root: Object3D): string;
1937
+ /** Returns PLY geometry with vertex colors and UVs; texture images are not included. */
1938
+ static toPLY(root: Object3D, options?: PLYExporterOptions): string | ArrayBuffer;
1939
+ /**
1940
+ * Exports a static glTF/GLB snapshot in a browser. Atlas textures and vertex tints are retained;
1941
+ * MineRender's custom directional lighting is not baked into the exported materials.
1942
+ */
1943
+ static toGLTF(root: Object3D, options?: SceneGLTFExportOptions): Promise<Record<string, any> | ArrayBuffer>;
1944
+ }
1945
+
1946
+ declare class GuiHelper {
1947
+ /** Sizes a tooltip around supplied text; the first entry is its title. */
1948
+ static tooltip(lines: readonly GuiText[], options?: GuiTooltipOptions): Promise<GuiLayer[]>;
1949
+ static inventorySlot(slot: number | [number, number], origin?: [number, number], offset?: [number, number], rowSize?: number): [number, number];
1950
+ /** Creates crafting-table layers for ingredients and the result; stack counts are not drawn. */
1951
+ static recipe(recipe: GuiRecipe, options?: GuiRecipeOptions): GuiLayer[];
1952
+ }
1953
+ interface GuiTooltipOptions extends GuiTextOptions {
1954
+ /** Top-left text position, inside the tooltip's padding. */
1955
+ position?: [number, number];
1956
+ /** Extra space after the title, in pixels. Defaults to 2. */
1957
+ titleGap?: number;
1958
+ }
1959
+ type GuiRecipeIngredientValue = string | {
1960
+ item: string;
1961
+ } | {
1962
+ tag: string;
1963
+ };
1964
+ type GuiRecipeIngredient = GuiRecipeIngredientValue | readonly GuiRecipeIngredientValue[];
1965
+ type GuiRecipe = ({
1966
+ type: "minecraft:crafting_shaped" | "crafting_shaped";
1967
+ pattern: readonly string[];
1968
+ key: Readonly<Record<string, GuiRecipeIngredient>>;
1969
+ } | {
1970
+ type: "minecraft:crafting_shapeless" | "crafting_shapeless";
1971
+ ingredients: readonly GuiRecipeIngredient[];
1972
+ }) & {
1973
+ result: {
1974
+ id: string;
1975
+ count?: number;
1976
+ } | {
1977
+ item: string;
1978
+ count?: number;
1979
+ };
1980
+ };
1981
+ interface GuiRecipeOptions {
1982
+ /** Selects a concrete item ID or model AssetKey for a tag or alternatives array. */
1983
+ resolveIngredient?: (ingredient: GuiRecipeIngredient) => string | AssetKey;
1242
1984
  }
1243
1985
 
1986
+ /** Builds one centered mesh; explicit source-pixel crops always stretch. */
1987
+ declare function createGuiTextureGeometry(width: number, height: number, imageWidth: number, imageHeight: number, crop?: [number, number, number, number], scaling?: GuiSpriteScaling): BufferGeometry;
1988
+
1244
1989
  declare class OrbitControls {
1245
1990
  constructor(object: Camera, domElement?: HTMLElement);
1246
1991
 
@@ -1333,7 +2078,10 @@ declare class Renderer implements Disposable {
1333
2078
  protected _frameInterval?: number;
1334
2079
  protected _resizeListener?: () => void;
1335
2080
  private _nextFrameTime?;
2081
+ private _running;
2082
+ private _inAnimationLoop;
1336
2083
  private _disposed;
2084
+ private readonly _frameCallbacks;
1337
2085
  private readonly _debugHelpers;
1338
2086
  private readonly _eventDispatchers;
1339
2087
  private readonly _changeListener;
@@ -1354,6 +2102,12 @@ declare class Renderer implements Disposable {
1354
2102
  resize(width: number, height: number): void;
1355
2103
  get dirty(): boolean;
1356
2104
  set dirty(dirty: boolean);
2105
+ /**
2106
+ * Calls a synchronous animation update before each FPS-limited draw while started.
2107
+ * Subscriptions keep the scene drawing without manual dirty flags. Returns an unsubscribe function.
2108
+ * Registering the same callback twice has no effect. Image exports do not invoke callbacks.
2109
+ */
2110
+ onFrame(callback: FrameCallback): () => void;
1357
2111
  start(): void;
1358
2112
  stop(): void;
1359
2113
  /**
@@ -1363,7 +2117,16 @@ declare class Renderer implements Disposable {
1363
2117
  */
1364
2118
  dispose(): void;
1365
2119
  private animate;
1366
- toImage(): string;
2120
+ private drawFrame;
2121
+ /**
2122
+ * Renders a fresh frame and returns an image data URL, including while the animation loop is stopped.
2123
+ * Trimming removes transparent borders; an empty image becomes one transparent pixel.
2124
+ * MIME type support and lossy quality (0–1) follow the canvas encoder.
2125
+ */
2126
+ toImage(trim?: boolean, mime?: string, quality?: number): string;
2127
+ toObj(): string;
2128
+ toPLY(options?: PLYExporterOptions): string | ArrayBuffer;
2129
+ toGLTF(options?: SceneGLTFExportOptions): Promise<Record<string, any> | ArrayBuffer>;
1367
2130
  protected get attachedToBody(): boolean;
1368
2131
  protected get viewWidth(): number;
1369
2132
  protected get viewHeight(): number;
@@ -1374,6 +2137,13 @@ declare class Renderer implements Disposable {
1374
2137
  /** Renderer-owned controls, or undefined when disabled at construction or after disposal. */
1375
2138
  get controls(): Maybe<OrbitControls>;
1376
2139
  }
2140
+ interface RendererFrame {
2141
+ /** Animation-loop timestamp in seconds, relative to the browser's performance time origin. */
2142
+ readonly time: number;
2143
+ /** Seconds since this callback's previous update; zero on its first update after subscribing or starting. */
2144
+ readonly delta: number;
2145
+ }
2146
+ type FrameCallback = (frame: RendererFrame) => void;
1377
2147
  interface RendererOptions {
1378
2148
  camera: CameraOptions;
1379
2149
  render: RenderOptions;
@@ -1401,6 +2171,8 @@ interface CameraOptions {
1401
2171
  interface RenderOptions {
1402
2172
  /** Maximum draw rate (60 by default); zero or a negative value disables the limit. */
1403
2173
  fpsLimit: number;
2174
+ /** Drawing-buffer pixels per CSS pixel (default 1); also scales toImage() output. */
2175
+ pixelRatio?: number;
1404
2176
  stats: boolean;
1405
2177
  antialias: boolean;
1406
2178
  shade: boolean;
@@ -1425,17 +2197,21 @@ declare class SceneInspector {
1425
2197
  protected readonly raycaster: Raycaster;
1426
2198
  private readonly mouse;
1427
2199
  private selectedObject?;
2200
+ private pointer?;
2201
+ private readonly listeners;
1428
2202
  constructor(renderer: Renderer);
1429
2203
  protected init(): void;
1430
- findMeshChildren(from: Object3D, out?: Mesh[]): Mesh<three.BufferGeometry<three.NormalBufferAttributes>, three.Material | three.Material[], three.Object3DEventMap>[];
1431
- onClick(event: any): void;
2204
+ dispose(): void;
2205
+ findMeshChildren(from: Object3D, out?: Mesh[]): Mesh<three.BufferGeometry<three.NormalBufferAttributes, three.BufferGeometryEventMap>, three.Material<three.MaterialEventMap> | three.Material<three.MaterialEventMap>[], three.Object3DEventMap>[];
2206
+ onClick(event: MouseEvent): void;
1432
2207
  appendTo(el: HTMLElement): void;
1433
2208
  protected handleRaycasterObjects(intersections: Intersection[]): void;
1434
- selectObject(targetObject: Object3D, targetIntersection?: Intersection): void;
1435
- protected redraw(targetObject: Object3D, targetIntersection?: Intersection): void;
1436
- protected addControls(object: Object3D, intersection?: Intersection): void;
2209
+ private getIntersectionInstance;
2210
+ selectObject(targetObject: Object3D, targetIntersection?: Intersection, instance?: Maybe<InstanceReference<SceneObject>>): void;
2211
+ protected redraw(targetObject: Object3D, targetIntersection?: Intersection, instance?: InstanceReference<SceneObject>): void;
2212
+ protected addControls(object: Object3D, intersection?: Intersection, instance?: InstanceReference<SceneObject>): void;
1437
2213
  protected addInfoLine(name: string, id: string, value: any): HTMLElement;
1438
- protected addObjectControls(target: Object3D, intersection: Maybe<Intersection>, container: HTMLElement): void;
2214
+ protected addObjectControls(target: Object3D, intersection: Maybe<Intersection>, container: HTMLElement, instance?: InstanceReference<SceneObject>): void;
1439
2215
  protected buttonControl(name: string, id: string, click: () => void): HTMLElement;
1440
2216
  protected selectControl(name: string, id: string, options: string[], change: (v: string) => void): HTMLElement;
1441
2217
  protected toggleControl(name: string, id: string, val: boolean, change: (v: boolean) => void): HTMLElement;
@@ -1443,13 +2219,15 @@ declare class SceneInspector {
1443
2219
  protected separator(name?: string): HTMLElement;
1444
2220
  }
1445
2221
 
1446
- declare class SceneStatsDisplay {
2222
+ declare class SceneStatsDisplay implements Disposable {
1447
2223
  readonly renderer: Renderer;
1448
2224
  readonly statsContainer: HTMLDivElement;
1449
2225
  private readonly lines;
2226
+ private interval?;
1450
2227
  constructor(renderer: Renderer);
1451
2228
  protected init(): void;
1452
2229
  appendTo(el: HTMLElement): void;
2230
+ dispose(): void;
1453
2231
  add(line?: StatLine): void;
1454
2232
  }
1455
2233
  declare class StatLine {
@@ -1464,35 +2242,33 @@ declare class StatLine {
1464
2242
  update(): void;
1465
2243
  }
1466
2244
 
1467
- declare class Requests {
1468
- private static axiosInstance;
1469
- private static mcAssetInstance;
1470
- private static genericQueue;
1471
- private static mcAssetRequestQueue;
1472
- static genericRequest(request: AxiosRequestConfig): Promise<AxiosResponse>;
1473
- static mcAssetRequest(request: AxiosRequestConfig): Promise<AxiosResponse>;
1474
- private static shouldRetry;
1475
- static setMcAssetRoot(root: string): void;
1476
- static get queueSizes(): {
1477
- generic: number;
1478
- mcAsset: number;
1479
- };
1480
- /**
1481
- * Permanently stops both queues and rejects waiting and future requests.
1482
- * Requests already running can finish. Idle queues hold no timer, so Node can exit without
1483
- * this cleanup. See {@link shutdown}.
1484
- */
1485
- static end(): void;
1486
- }
1487
-
1488
2245
  type SkinGeometries = Record<SkinPart, TripleArray>;
1489
2246
  declare const classicSkinGeometries: SkinGeometries;
1490
2247
  declare const slimSkinGeometries: SkinGeometries;
1491
2248
 
2249
+ declare class SkinImage {
2250
+ static getData(src: string): Promise<ImageData>;
2251
+ private static decodePng;
2252
+ }
2253
+
1492
2254
  type SkinTextureCoordinates = Record<SkinPart, ModelFaces>;
1493
2255
  declare const classicSkinTextureCoordinates: Readonly<SkinTextureCoordinates>;
1494
2256
  declare const slimSkinTextureCoordinates: Readonly<SkinTextureCoordinates>;
1495
2257
 
2258
+ interface SkinTexture {
2259
+ material: MeshBasicMaterial;
2260
+ slim: boolean;
2261
+ legacy: boolean;
2262
+ }
2263
+ declare class SkinTextures {
2264
+ static get(src: string, legacy?: boolean): Promise<SkinTexture>;
2265
+ static getCape(src: string, layout?: CapeLayout): Promise<MeshBasicMaterial>;
2266
+ private static createMaterial;
2267
+ private static isSlim;
2268
+ private static normalizeLegacy;
2269
+ private static makeBaseOpaque;
2270
+ }
2271
+
1496
2272
  declare class Skins {
1497
2273
  static fromUuidOrUsername(uuidOrUsername: string): Promise<Maybe<string>>;
1498
2274
  static fromUuid(uuid: string): Promise<Maybe<string>>;
@@ -1501,8 +2277,11 @@ declare class Skins {
1501
2277
  static capeFromUuidOrUsername(uuidOrUsername: string): Promise<Maybe<string>>;
1502
2278
  static capeFromUuid(uuid: string): Promise<Maybe<string>>;
1503
2279
  static capeFromUsername(username: string): Promise<Maybe<string>>;
1504
- static capeFromCapesDev(uuid: string, capeType?: string): Promise<Maybe<string>>;
2280
+ /** Returns a full static cape texture for a username or UUID. */
2281
+ static capeFromCapesDev(player: string, capeType?: string): Promise<Maybe<string>>;
1505
2282
  private static usernameToUuid;
2283
+ private static usernameToUuidMcProxy;
2284
+ /** @deprecated **/
1506
2285
  private static usernameToUuidSkinProxy;
1507
2286
  private static usernameToUuidMineTools;
1508
2287
  private static getProfileFromMinetools;
@@ -1512,8 +2291,17 @@ declare class Skins {
1512
2291
  private static getCrafatarCapeUrl;
1513
2292
  private static getMcHeadsSkinUrl;
1514
2293
  private static getMineSkinPlayerSkinUrl;
2294
+ /** @deprecated **/
1515
2295
  private static getSkinProxySkinUrl;
2296
+ /** @deprecated **/
1516
2297
  private static getSkinProxyCapeUrl;
2298
+ private static getMcProxySkinUrl;
2299
+ private static getMcProxyCapeUrl;
2300
+ }
2301
+
2302
+ declare class Colormaps {
2303
+ /** Samples the selected resource pack's grass colormap using Minecraft's climate coordinates. */
2304
+ static grassColor(origin?: AssetKey, temperature?: number, downfall?: number): Promise<number>;
1517
2305
  }
1518
2306
 
1519
2307
  declare class TextureLoader {
@@ -1526,6 +2314,8 @@ declare class TextureLoader {
1526
2314
  }
1527
2315
 
1528
2316
  declare class Textures {
2317
+ /** Creates the shared checkerboard from pixels without fetching or decoding an image. */
2318
+ static getMissing(): DataTexture;
1529
2319
  static initTextureProps<T extends Texture>(texture: T): T;
1530
2320
  static createImage(key: TextureKey): Texture;
1531
2321
  static createAsset(key: AssetKey): Texture;
@@ -1541,61 +2331,165 @@ declare function mergeVertices(geometry: BufferGeometry, tolerance?: number): Bu
1541
2331
  declare function toTrianglesDrawMode(geometry: BufferGeometry, drawMode: TrianglesDrawModes): BufferGeometry;
1542
2332
  declare function computeMorphedAttributes(object: Mesh | Line | Points): object;
1543
2333
 
1544
- interface BlockInfo {
1545
- block: Block;
1546
- object: BlockObject;
2334
+ declare class ChunkData {
2335
+ private readonly indices;
2336
+ private readonly palette;
2337
+ private readonly paletteIds;
2338
+ private readonly freeIds;
2339
+ private readonly nbt;
2340
+ get(index: number): Maybe<Block>;
2341
+ snapshot(index: number): Maybe<() => Block>;
2342
+ set(index: number, block?: Block): void;
2343
+ clear(): void;
2344
+ static isAir(block: Maybe<Block>): boolean;
2345
+ private static copyBlock;
2346
+ private static validateIndex;
2347
+ }
2348
+
2349
+ type RegionInput = Uint8Array | ArrayBuffer;
2350
+ interface AnvilRegion {
2351
+ chunks: AnvilChunk[];
2352
+ }
2353
+ interface AnvilChunk {
2354
+ x: number;
2355
+ z: number;
2356
+ dataVersion?: number;
2357
+ sections: {
2358
+ y: number;
2359
+ data: ChunkData;
2360
+ }[];
2361
+ entities?: MultiBlockEntity[];
2362
+ }
2363
+ declare class AnvilParser {
2364
+ static getChunkList(data: RegionInput): {
2365
+ x: number;
2366
+ z: number;
2367
+ }[];
2368
+ static parse(data: RegionInput): Promise<AnvilRegion>;
2369
+ static parseChunk(data: RegionInput, localX: number, localZ: number): Promise<AnvilChunk | undefined>;
2370
+ private static bytes;
2371
+ private static locations;
2372
+ private static readChunk;
2373
+ private static compounds;
2374
+ private static integer;
2375
+ private static block;
2376
+ private static unpack;
2377
+ }
2378
+
2379
+ interface BlockInfo<SectionMeshing extends boolean = false> {
2380
+ /** Detached block data; use world or chunk setters to update stored blocks. */
2381
+ readonly block: Block;
2382
+ /** Merged terrain has no individual render object in section-meshing mode. */
2383
+ object: SectionMeshing extends false ? BlockObject : BlockObject | undefined;
2384
+ }
2385
+
2386
+ interface SectionMeshTemplate {
2387
+ geometry: BufferGeometry;
2388
+ atlas: TextureAtlas;
2389
+ cullFaces: readonly number[];
2390
+ }
2391
+ interface SectionMeshEntry {
2392
+ index: number;
2393
+ template: SectionMeshTemplate;
2394
+ cullMask: number;
2395
+ }
2396
+ declare class SectionMesh extends Group {
2397
+ private readonly ownedMeshes;
2398
+ static build(entries: readonly SectionMeshEntry[], maxAtlasSize?: number): SectionMesh;
2399
+ dispose(): void;
2400
+ }
2401
+
2402
+ declare class SectionModels {
2403
+ readonly maxAtlasSize: number;
2404
+ private states;
2405
+ private models;
2406
+ private readonly templates;
2407
+ constructor(maxAtlasSize?: number);
2408
+ get(blockState: BlockState, properties?: BlockStateProperties): Promise<SectionMeshTemplate | undefined>;
2409
+ private prepare;
2410
+ clear(): void;
1547
2411
  }
1548
2412
 
1549
- declare class Chunk {
2413
+ declare class Chunk<SectionMeshing extends boolean = false> {
2414
+ private readonly onBlocksChanged?;
2415
+ private readonly sectionModels?;
1550
2416
  readonly scene: MineRenderScene;
1551
2417
  readonly x: number;
1552
2418
  readonly y: number;
1553
2419
  readonly z: number;
1554
- private readonly _blocks;
1555
- private readonly _anchor;
1556
- constructor(scene: MineRenderScene, x: number, y: number, z: number);
1557
- getBlockAt(x: number, y: number, z: number): Maybe<BlockInfo>;
1558
- getBlockAt(pos: Vector3): Maybe<BlockInfo>;
1559
- getBlockAt(pos: TripleArray): Maybe<BlockInfo>;
2420
+ private readonly data;
2421
+ private readonly renderedBlocks;
2422
+ private readonly sectionBlocks;
2423
+ private readonly hiddenBlocks;
2424
+ private sectionMesh?;
2425
+ private meshDirty;
2426
+ constructor(scene: MineRenderScene, x: number, y: number, z: number, onBlocksChanged?: ((positions: Vector3[]) => Promise<void>) | undefined, sectionModels?: SectionModels | undefined);
2427
+ getBlockAt(x: number, y: number, z: number): Maybe<BlockInfo<SectionMeshing>>;
2428
+ getBlockAt(pos: Vector3): Maybe<BlockInfo<SectionMeshing>>;
2429
+ getBlockAt(pos: TripleArray): Maybe<BlockInfo<SectionMeshing>>;
1560
2430
  /**
1561
2431
  * Set block at a _world_ position
1562
2432
  */
1563
- setBlockAt(x: number, y: number, z: number, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
1564
- setBlockAt(pos: Vector3, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
1565
- setBlockAt(pos: TripleArray, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
2433
+ setBlockAt(x: number, y: number, z: number, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2434
+ setBlockAt(pos: Vector3, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2435
+ setBlockAt(pos: TripleArray, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
1566
2436
  /**
1567
- * Set block at a _chunk_ position (0-16)
2437
+ * Set a block at integer chunk-local coordinates from 0 to 15.
1568
2438
  */
1569
- setBlockInChunkAt(pos: Vector3, block?: Block, worldPos?: Vector3): Promise<Maybe<BlockInfo>>;
1570
- clear(): Promise<void>;
2439
+ setBlockInChunkAt(pos: Vector3, block?: Block, worldPos?: Vector3, onBlocksChanged?: ((positions: Vector3[]) => Promise<void>) | undefined): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2440
+ setBlockVisibleAt(pos: Vector3, visible: boolean): Promise<void>;
2441
+ isBlockVisibleAt(pos: Vector3): boolean;
2442
+ isOccludingAt(pos: Vector3): boolean;
2443
+ setCullMaskAt(pos: Vector3, mask: number): Promise<void>;
2444
+ rebuildSectionMesh(): void;
2445
+ clear(onBlocksChanged?: ((positions: Vector3[]) => Promise<void>) | undefined): Promise<void>;
1571
2446
  dispose(): Promise<void>;
2447
+ static isAir(block: Maybe<Block>): boolean;
1572
2448
  static chunkPosToBlockIndex(pos: Vector3): number;
1573
2449
  worldPosToChunkPos(pos: Vector3): Vector3;
1574
2450
  chunkPosToWorldPos(pos: Vector3): Vector3;
1575
2451
  }
1576
2452
 
1577
- declare class MineRenderWorld {
2453
+ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
1578
2454
  readonly scene: MineRenderScene;
1579
- private _size;
1580
- private _blockSize;
1581
2455
  private readonly _chunks;
1582
- constructor(scene: MineRenderScene);
1583
- getBlockAt(x: number, y: number, z: number): Maybe<BlockInfo>;
1584
- getBlockAt(pos: Vector3): Maybe<BlockInfo>;
1585
- getBlockAt(pos: TripleArray): Maybe<BlockInfo>;
1586
- setBlockAt(x: number, y: number, z: number, block: Block): Promise<Maybe<BlockInfo>>;
1587
- setBlockAt(pos: Vector3, block: Block): Promise<Maybe<BlockInfo>>;
1588
- setBlockAt(pos: TripleArray, block: Block): Promise<Maybe<BlockInfo>>;
2456
+ private readonly sectionModels?;
2457
+ private readonly pendingCulling;
2458
+ private culling?;
2459
+ constructor(scene: MineRenderScene, options?: MineRenderWorldOptions<SectionMeshing>);
2460
+ getBlockAt(x: number, y: number, z: number): Maybe<BlockInfo<SectionMeshing>>;
2461
+ getBlockAt(pos: Vector3): Maybe<BlockInfo<SectionMeshing>>;
2462
+ getBlockAt(pos: TripleArray): Maybe<BlockInfo<SectionMeshing>>;
2463
+ setBlockAt(x: number, y: number, z: number, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2464
+ setBlockAt(pos: Vector3, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2465
+ setBlockAt(pos: TripleArray, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2466
+ private placeBlock;
2467
+ /**
2468
+ * Shows or hides a placed block without changing its data. Hidden blocks do not occlude neighbors.
2469
+ * Missing blocks are ignored; replacing or removing a block resets its visibility.
2470
+ */
2471
+ setBlockVisibleAt(x: number, y: number, z: number, visible: boolean): Promise<void>;
2472
+ setBlockVisibleAt(pos: Vector3, visible: boolean): Promise<void>;
2473
+ setBlockVisibleAt(pos: TripleArray, visible: boolean): Promise<void>;
1589
2474
  placeMultiBlock(multiblock: MultiBlockStructure, useBatches?: boolean, executor?: BatchedExecutor): Promise<void>;
2475
+ private placeBlocks;
2476
+ /** Replaces one chunk column's blocks. Entity NBT remains available on the parsed chunk. */
2477
+ placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
1590
2478
  clear(): Promise<void>;
2479
+ private updateCulling;
1591
2480
  private getOrCreateChunkAt;
1592
- getChunkAt(pos: Vector3): Maybe<Chunk>;
2481
+ getChunkAt(pos: Vector3): Maybe<Chunk<SectionMeshing>>;
1593
2482
  static worldToScenePosition(pos: Vector3): Vector3;
1594
2483
  static sceneToWorldPosition(pos: Vector3): Vector3;
1595
- worldPosToChunkIndex(pos: Vector3): number;
1596
2484
  worldPosToChunkKey(pos: Vector3): string;
1597
2485
  validatePosBounds(pos: Vector3): void;
1598
2486
  }
2487
+ interface MineRenderWorldOptions<SectionMeshing extends boolean = boolean> {
2488
+ /** Merge static opaque cubes into section meshes. Merged blocks have no individual object. */
2489
+ sectionMeshing?: SectionMeshing;
2490
+ /** Maximum width and height of each section atlas page, in pixels. */
2491
+ maxAtlasSize?: number;
2492
+ }
1599
2493
 
1600
2494
  /**
1601
2495
  * {@link EnvProvider} backed by the DOM. Uses nothing outside of standard browser APIs and
@@ -1633,4 +2527,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
1633
2527
  */
1634
2528
  declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
1635
2529
 
1636
- export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, BlockEntityModels, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, Chunk, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, type Cube, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityModel, EntityModels, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, type ModelPart, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinObject, type SkinObjectOptions, SkinPart, type SkinTextureCoordinates, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, applyModelPartRotation, axisToVec3, base64decode, base64encode, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
2530
+ export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, Fonts, type FrameCallback, type FromTo, Geometries, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, SceneExporter, type SceneGLTFExportOptions, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };