minerender 2.1.0-alpha.7 → 2.1.0-alpha.73

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