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