minerender 2.1.0-alpha.6 → 2.1.0-alpha.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,23 @@
1
1
  import * as three from 'three';
2
- import { Vector3, PixelFormat, BoxGeometry, Material, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Scene, Object3DEventMap, Texture, Camera, MOUSE, TOUCH, WebGLRenderer, EventDispatcher, Raycaster, Intersection, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points } from 'three';
2
+ import { Vector3, PixelFormat, BoxGeometry, Material, ColorRepresentation, MeshBasicMaterial, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Box2, Scene, Object3DEventMap, Texture, Camera, MOUSE, TOUCH, WebGLRenderer, EventDispatcher, Raycaster, Intersection, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points, Group } from 'three';
3
3
  import * as nodeCanvas from 'canvas';
4
4
  import { ImageData as ImageData$1, CanvasRenderingContext2D } from 'canvas';
5
- import { AxiosResponse, AxiosRequestConfig } from 'axios';
6
- import { Buffer as Buffer$1 } from 'buffer';
7
- import { NBT } from 'prismarine-nbt';
5
+ import { Buffer } from 'buffer';
6
+ import { NBT, NBTFormat, Metadata } from 'prismarine-nbt';
8
7
  import { ZipReader } from '@zip.js/zip.js';
9
8
  import { AsyncLoadingCache, SimpleCache } from '@inventivetalent/loading-cache';
9
+ import { PLYExporterOptions } from 'three/examples/jsm/exporters/PLYExporter.js';
10
+ export { PLYExporterOptions } from 'three/examples/jsm/exporters/PLYExporter.js';
10
11
  import Stats from 'stats.js';
11
12
  import { EffectComposer } from 'postprocessing';
12
13
  import { LocalStorage } from 'node-persist';
13
14
 
14
15
  interface AnimatorFunction {
15
- (): void;
16
+ (): boolean | void;
16
17
  }
17
18
 
18
19
  declare enum Axis {
19
- X = "X",
20
+ X = "x",
20
21
  Y = "y",
21
22
  Z = "z"
22
23
  }
@@ -40,6 +41,7 @@ declare enum CubeFaceIndex {
40
41
  NORTH = 5
41
42
  }
42
43
  declare const CUBE_FACES: CubeFace[];
44
+ declare const CUBE_FACE_OFFSETS: readonly [readonly [1, 0, 0], readonly [-1, 0, 0], readonly [0, 1, 0], readonly [0, -1, 0], readonly [0, 0, 1], readonly [0, 0, -1]];
43
45
 
44
46
  interface Disposable {
45
47
  dispose(): void;
@@ -65,6 +67,7 @@ declare abstract class PersistentCache<B = unknown> {
65
67
  static open(name: string): PersistentCache;
66
68
  protected constructor(backing: B);
67
69
  abstract get<T>(key: string): Promise<T>;
70
+ /** Loads a missing entry and stores only non-nullish results. */
68
71
  getOrLoad<T>(key: string, loader: (key: string) => Promise<T>): Promise<T>;
69
72
  abstract put<T>(key: string, value: T): Promise<T>;
70
73
  abstract delete<T>(key: string): Promise<void>;
@@ -174,6 +177,7 @@ declare class AssetKey extends BasicAssetKey {
174
177
  rootType: "assets" | "data" | string;
175
178
  extension: ".json" | ".png" | string;
176
179
  root?: string | undefined;
180
+ readonly isAssetKey: true;
177
181
  constructor(namespace: string, path: string, assetType?: AssetType | undefined, type?: string | undefined, rootType?: "assets" | "data" | string, extension?: ".json" | ".png" | string, root?: string | undefined);
178
182
  static parse(assetType: AssetType, str: string, origin?: AssetKey): AssetKey;
179
183
  toString(): string;
@@ -196,11 +200,99 @@ interface ListAsset extends MinecraftAsset {
196
200
  files: string[];
197
201
  }
198
202
 
203
+ interface EntityLayer {
204
+ key: BasicAssetKey;
205
+ texture?: AssetKey;
206
+ layer: EntityModelLayer;
207
+ /** How this draw is rendered; defaults to the geometry layer's own mode, then `cutout`. */
208
+ render?: EntityRenderMode;
209
+ /** Label of the state colour that multiplies the texture, from the pass that selected this draw. */
210
+ tint?: string;
211
+ }
212
+ interface EntityModel extends EntityLayer {
213
+ id: string;
214
+ /** Root transform from the dataset; see {@link EntityTransformOp}. */
215
+ transform?: EntityTransformOp[];
216
+ /**
217
+ * Selected draws in draw order; the top-level fields describe the first selection.
218
+ * A key is the geometry layer's name; a further draw of the same geometry (a pass with another texture) is keyed `<layer>#<n>`, from 2.
219
+ */
220
+ layers?: Record<string, EntityLayer>;
221
+ }
222
+ interface EntityModelFile extends MinecraftAsset {
223
+ id: string;
224
+ transform?: EntityTransformOp[];
225
+ layers: Record<string, EntityModelLayer>;
226
+ /** Extra draws vanilla adds on top of `main`, in draw order. */
227
+ passes?: EntityModelPass[];
228
+ }
229
+ /** Vanilla render type of a draw; see the dataset README for the mode table. */
230
+ type EntityRenderMode = "cutout" | "cutout_cull" | "cutout_z_offset" | "solid" | "translucent" | "translucent_emissive" | "eyes" | "energy_swirl" | "breeze_wind" | "water_mask";
231
+ interface EntityModelPass {
232
+ /** Geometry layer of the same file; a pass on `main` draws that geometry again. */
233
+ layer: string;
234
+ /** Present only when it differs from the layer's own. */
235
+ textureLocation?: string;
236
+ /** Present only when it differs from the layer's own. */
237
+ render?: EntityRenderMode;
238
+ /** Entity state that enables the draw, e.g. `powered`; without it the pass is always drawn. */
239
+ when?: string;
240
+ /** State colour that multiplies the texture, e.g. `wool_color`. */
241
+ tint?: string;
242
+ }
243
+ /**
244
+ * One operation vanilla's renderer applies before drawing a model, in call order:
245
+ * each one is applied on top of the previous, so the last reaches the vertices first.
246
+ * Translations use model units and rotations use radians, like part poses.
247
+ */
248
+ type EntityTransformOp = {
249
+ scale: [number, number, number];
250
+ } | {
251
+ translate: [number, number, number];
252
+ } | {
253
+ rotate: [number, number, number];
254
+ };
255
+ interface EntityModelLayer {
256
+ texture: [number, number];
257
+ textureLocation?: string;
258
+ /** Omitted for `cutout`. */
259
+ render?: EntityRenderMode;
260
+ root: EntityModelPart;
261
+ }
262
+ interface EntityModelPart {
263
+ pose: {
264
+ offset: [number, number, number];
265
+ rotation: [number, number, number];
266
+ scale?: [number, number, number];
267
+ };
268
+ texture?: [number, number];
269
+ cubes: EntityModelCube[];
270
+ children: Record<string, EntityModelPart>;
271
+ }
272
+ interface EntityModelCube {
273
+ origin: [number, number, number];
274
+ size: [number, number, number];
275
+ uv: [number, number];
276
+ grow?: [number, number, number];
277
+ mirror?: boolean;
278
+ }
279
+
199
280
  declare class Materials {
200
281
  private static readonly MISSING_TEXTURE_SRC;
201
282
  static get MISSING_TEXTURE(): Material;
202
283
  static createImage(key: MaterialKey): Material;
203
284
  static createBasicCanvasMaterial(canvas: HTMLCanvasElement, transparent?: boolean, shade?: boolean): Material;
285
+ /** Whether vanilla's render type for the mode culls back faces. */
286
+ static entityModeCulls(mode?: EntityRenderMode): boolean;
287
+ /** UV offset per tick of entity age for the scrolling modes, as vanilla's texture matrix applies it. */
288
+ static entityModeScroll(mode?: EntityRenderMode): [number, number] | undefined;
289
+ /**
290
+ * Entity material for one of vanilla's render types. Entities are unlit here, so the lit and full-bright modes
291
+ * differ only in blending and depth state. Culling is not a material property: {@link entityModeCulls} decides
292
+ * whether the geometry gets inward faces.
293
+ */
294
+ static createEntityCanvasMaterial(canvas: HTMLCanvasElement, mode?: EntityRenderMode, tint?: ColorRepresentation): MeshBasicMaterial;
295
+ static createGuiCanvasMaterial(canvas: HTMLCanvasElement): MeshBasicMaterial;
204
296
  static createShadedCanvasMaterial(canvas: HTMLCanvasElement, transparent?: boolean, shade?: boolean): Material;
205
297
  static getImage(key: MaterialKey): Material;
206
298
  static needsUpdate(mat: Material): void;
@@ -246,7 +338,8 @@ declare enum DisplayPosition {
246
338
  GUI = "gui",
247
339
  HEAD = "head",
248
340
  GROUND = "ground",
249
- FIXED = "fixed"
341
+ FIXED = "fixed",
342
+ ON_SHELF = "on_shelf"
250
343
  }
251
344
  declare const DISPLAY_POSITIONS: DisplayPosition[];
252
345
 
@@ -255,6 +348,46 @@ declare enum GuiLight {
255
348
  SIDE = "side"
256
349
  }
257
350
 
351
+ interface RequestConfig extends RequestInit {
352
+ url: string;
353
+ /** Prepended to relative URLs, preserving any path in the base URL. */
354
+ baseURL?: string;
355
+ /** Timeout per attempt in milliseconds, including body reading. Defaults to 5000; 0 disables it. */
356
+ timeout?: number;
357
+ responseType?: "json" | "arraybuffer";
358
+ }
359
+ interface RequestResponse<T = any> {
360
+ data: T;
361
+ status: number;
362
+ statusText: string;
363
+ headers: Headers;
364
+ /** Final URL after redirects. */
365
+ url: string;
366
+ }
367
+ declare class RequestError extends Error {
368
+ readonly response?: RequestResponse<undefined> | undefined;
369
+ readonly cause?: unknown;
370
+ constructor(message: string, response?: RequestResponse<undefined> | undefined, cause?: unknown);
371
+ }
372
+ declare class Requests {
373
+ private static genericQueue;
374
+ private static mcAssetRequestQueue;
375
+ static genericRequest(request: RequestConfig): Promise<RequestResponse>;
376
+ static mcAssetRequest(request: RequestConfig): Promise<RequestResponse>;
377
+ static setMcAssetRoot(root: string): void;
378
+ /** Counts unsettled calls, including retry delays and requests still running after shutdown. */
379
+ static get queueSizes(): {
380
+ generic: number;
381
+ mcAsset: number;
382
+ };
383
+ /**
384
+ * Permanently stops both queues and rejects waiting, retrying, and future requests.
385
+ * Requests already running can finish. Idle queues hold no timer, so Node can exit without
386
+ * this cleanup. See {@link shutdown}.
387
+ */
388
+ static end(): void;
389
+ }
390
+
258
391
  declare class WrappedImage {
259
392
  readonly dta: ExtractableImageData;
260
393
  constructor(dta: ExtractableImageData);
@@ -278,7 +411,7 @@ interface ImageInfo {
278
411
  width: number;
279
412
  height: number;
280
413
  type?: string;
281
- data: Buffer$1;
414
+ data: Buffer;
282
415
  }
283
416
  declare class ImageLoader {
284
417
  protected static _createImage(): CompatImage;
@@ -290,7 +423,7 @@ declare class ImageLoader {
290
423
  static infoToData(info: ImageInfo): Promise<ImageData>;
291
424
  static getData(src: string): Promise<ImageData>;
292
425
  static getCanvasData(src: string): Promise<ExtractableImageData>;
293
- static processResponse(response: Partial<AxiosResponse>): Promise<ImageInfo>;
426
+ static processResponse(response: Pick<RequestResponse<ArrayBuffer>, "data" | "url">): Promise<ImageInfo>;
294
427
  static loadInfo(src: string): Promise<ImageInfo>;
295
428
  static getInfo(src: string): Promise<ImageInfo>;
296
429
  static loadWrapped(src: string): Promise<WrappedImage>;
@@ -304,7 +437,7 @@ declare const DEFAULT_ELEMENTS: ModelElement[];
304
437
  interface Model extends MinecraftAsset {
305
438
  textures?: IModelTextures;
306
439
  parent?: string;
307
- display?: ModelDisplay;
440
+ display?: Partial<Record<DisplayPosition, ModelDisplay>>;
308
441
  elements?: ModelElement[];
309
442
  hierarchy?: string[];
310
443
  }
@@ -315,11 +448,41 @@ interface BlockModel extends Model {
315
448
  interface ItemModel extends Model {
316
449
  textures?: ItemModelTextures;
317
450
  gui_light?: GuiLight;
318
- }
451
+ special?: SpecialItemRenderer;
452
+ tints?: ItemTintSource[];
453
+ }
454
+ type ItemTintColor = number | TripleArray;
455
+ type ItemTintSource = {
456
+ type: "constant" | "minecraft:constant";
457
+ value: ItemTintColor;
458
+ } | {
459
+ type: "grass" | "minecraft:grass";
460
+ temperature: number;
461
+ downfall: number;
462
+ } | {
463
+ type: "dye" | "minecraft:dye" | "potion" | "minecraft:potion" | "map_color" | "minecraft:map_color" | "firework" | "minecraft:firework" | "team" | "minecraft:team";
464
+ default: ItemTintColor;
465
+ } | {
466
+ type: "custom_model_data" | "minecraft:custom_model_data";
467
+ index?: number;
468
+ default: ItemTintColor;
469
+ };
470
+ type SpecialItemRenderer = {
471
+ type: "chest" | "minecraft:chest";
472
+ texture: string;
473
+ openness?: number;
474
+ } | {
475
+ type: "bed" | "minecraft:bed";
476
+ texture: string;
477
+ } | {
478
+ type: "head" | "minecraft:head";
479
+ kind: string;
480
+ texture?: string;
481
+ animation?: number;
482
+ };
319
483
  interface TextureAsset extends MinecraftAsset, ImageInfo {
320
484
  }
321
485
  interface ModelDisplay {
322
- position?: DisplayPosition;
323
486
  translation?: TripleArray;
324
487
  rotation?: TripleArray;
325
488
  scale?: TripleArray;
@@ -339,13 +502,7 @@ declare function isDoubleArray(obj: any): obj is DoubleArray;
339
502
  declare function isTripleArray(obj: any): obj is TripleArray;
340
503
  declare function isQuadArray(obj: any): obj is QuadArray;
341
504
 
342
- /**
343
- * down up
344
- * east north west south
345
- *
346
- * bottom-left to top-right
347
- * [bl, br, tl, tr]
348
- */
505
+ /** Vanilla Minecraft cube UVs in Three.js BoxGeometry face and vertex order. */
349
506
  declare class MinecraftCubeTexture {
350
507
  readonly u: number;
351
508
  readonly v: number;
@@ -361,7 +518,7 @@ declare class MinecraftCubeTexture {
361
518
  getUvSouth(w: number, h: number, l: number): QuadArray<DoubleArray>;
362
519
  getUvNorth(w: number, h: number, l: number): QuadArray<DoubleArray>;
363
520
  getFaceUv(face: CubeFace, w: number, h: number, l: number): QuadArray<DoubleArray>;
364
- toUvArray(w: number, h: number, l: number): number[];
521
+ toUvArray(w: number, h: number, l: number, mirror?: boolean): number[];
365
522
  }
366
523
 
367
524
  interface MinecraftTextureMeta extends MinecraftAsset {
@@ -489,6 +646,7 @@ declare class TextureAtlas implements Disposable {
489
646
  };
490
647
  readonly hasTransparency: boolean;
491
648
  ticker?: number;
649
+ private readonly subscribers;
492
650
  constructor(model: Model, image: CanvasImage, sizes: {
493
651
  [texture: string]: DoubleArray;
494
652
  }, positions: {
@@ -496,6 +654,8 @@ declare class TextureAtlas implements Disposable {
496
654
  }, hasAnimation: boolean, animatorFunctions: {
497
655
  [p: string]: AnimatorFunction;
498
656
  }, hasTransparency: boolean);
657
+ /** Calls subscribers when an animation frame changes; unused atlases do not tick. */
658
+ subscribe(callback: () => void): () => void;
499
659
  getData(texture: string): ImageData$1;
500
660
  dispose(): void;
501
661
  }
@@ -514,6 +674,7 @@ declare class UVMapper {
514
674
  static setCubeUvs(geometry: BoxGeometry, originalTextureSize: DoubleArray, actualTextureSize: DoubleArray, faces: ModelFaces): void;
515
675
  static facesToUvArray(faces: ModelFaces, originalTextureSize: DoubleArray, actualTextureSize: DoubleArray): number[];
516
676
  static facesToUv(faces: ModelFaces, originalTextureSize: DoubleArray, actualTextureSize: DoubleArray): Float32BufferAttribute;
677
+ static lockUvs(geometry: BoxGeometry, faces: ModelFaces, atlas: TextureAtlas, rotation: Euler): void;
517
678
  static getAtlas(model: Model): Promise<Maybe<TextureAtlas>>;
518
679
  static fillMissingTextureKeys<T>(textures: ModelTextures, target: {
519
680
  [k: string]: T;
@@ -535,14 +696,13 @@ declare class MinecraftFaceUV {
535
696
  }
536
697
 
537
698
  /**
538
- * Releases every long-lived timer MineRender holds, so a Node process can exit.
699
+ * Stops the shared Ticker and request queues, and clears the in-memory caches.
539
700
  *
540
- * Both `@inventivetalent/loading-cache` (cache expiry) and `jobqu` (request queue draining) use
541
- * self-rescheduling timers that are not unref'd, which keeps the event loop alive for as long as
542
- * the library is loaded. Browsers don't care, but anything headless - a render server, a CLI, a
543
- * test run - has to call this when it's done.
701
+ * Idle Node processes can exit without calling this: cache and Ticker timers are unref'd,
702
+ * and idle request queues hold no timer. Pending requests keep their normal timer references.
544
703
  *
545
- * The library stays usable afterwards; the caches and queues simply start over.
704
+ * Call this only when finished with MineRender. Queued, retrying, and future requests reject;
705
+ * HTTP requests already running can finish. Queue shutdown is permanent, and cache expiry timers do not restart.
546
706
  */
547
707
  declare function shutdown(): void;
548
708
 
@@ -550,46 +710,19 @@ declare class BatchedExecutor {
550
710
  readonly interval: number;
551
711
  readonly batch: number;
552
712
  private readonly queue;
553
- private readonly task;
554
713
  constructor(interval?: number, batch?: number);
555
- submit(task: Task): void;
556
- private run;
557
- private runNext;
714
+ submit<T>(task: Task<T>): Promise<T>;
715
+ stop(): void;
558
716
  }
559
- type Task = () => any | Promise<any>;
717
+ type Task<T = unknown> = () => T | Promise<T>;
560
718
 
561
719
  declare function prefix(prefix?: string): string;
562
720
 
563
- interface ModelPart {
564
- textureWidth: number;
565
- textureHeight: number;
566
- textureOffsetU: number;
567
- textureOffsetV: number;
568
- pivotX: number;
569
- pivotY: number;
570
- pivotZ: number;
571
- pitch: number;
572
- yaw: number;
573
- roll: number;
574
- mirror: boolean;
575
- cubes: Cube[];
576
- children: ModelPart[];
577
- }
578
- interface Cube {
579
- minX: number;
580
- minY: number;
581
- minZ: number;
582
- maxX: number;
583
- maxY: number;
584
- maxZ: number;
585
- }
586
-
587
721
  declare function applyElementRotation(rotation: ElementRotation, geometry: BufferGeometry): void;
588
- declare function applyModelPartRotation(modelPart: ModelPart, geometry: BufferGeometry): void;
589
722
  declare function applyGenericRotation(axis: Axis, rotation: number, obj: Object3D): void;
590
723
  declare function addBox3WireframeToObject(box: Box3, obj: Object3D, color?: number, w?: number): void;
591
724
  declare function addWireframeToObject(obj: Object3D, color?: number, w?: number): void;
592
- declare function addWireframeToMesh(geo: BufferGeometry, mesh: Mesh, color?: number, w?: number): void;
725
+ declare function addWireframeToMesh(geo: BufferGeometry, mesh: Mesh, color?: number, w?: number): () => void;
593
726
 
594
727
  declare function captureException(e: any, ...extra: any[]): void;
595
728
  declare function timingStart(marker: string): void;
@@ -614,16 +747,47 @@ declare enum AssetParser {
614
747
  declare abstract class AssetSource {
615
748
  protected constructor();
616
749
  abstract get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
750
+ /**
751
+ * Identifies this source's content across sessions for persistent caching. Sources that
752
+ * cannot tell whether their content changed (an unnamed archive, for example) return
753
+ * undefined, which keeps their results out of long-lived caches.
754
+ */
755
+ get cacheId(): Maybe<string>;
756
+ }
757
+ /** A source failed to load or parse an asset; cause retains the original failure. */
758
+ declare class AssetLoadError extends Error {
759
+ readonly source: AssetSource;
760
+ readonly key: AssetKey;
761
+ readonly path: string;
762
+ readonly cause: unknown;
763
+ constructor(source: AssetSource, key: AssetKey, path: string, cause: unknown);
617
764
  }
618
765
 
619
766
  declare class AssetLoader {
620
767
  static ROOT: string;
621
768
  private static _SOURCES;
769
+ /** Used when a registered source cannot identify its content, so nothing persists past this session. */
770
+ private static readonly SESSION_SCOPE;
771
+ static get version(): string;
772
+ static setVersion(version: string): void;
773
+ /**
774
+ * Scope for persistent cache keys. Empty with only the default vanilla sources, so their
775
+ * entries stay valid across sessions; otherwise it names every added source (resource packs,
776
+ * mirrors) so their results never masquerade as vanilla assets after a reload.
777
+ */
778
+ static get persistentScope(): string;
779
+ /** Prefixes a persistent cache key with the current source scope. */
780
+ static persistentKey(key: string): string;
622
781
  static addSource(key: string, source: AssetSource, override?: boolean): void;
623
782
  static removeSource(key: string): Maybe<AssetSource>;
624
783
  static getAll<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<T[]>;
625
784
  /** Returns the first defined result in source-priority order, without merging assets. */
626
785
  static get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
786
+ /** Tries each path within a source before considering lower-priority sources. */
787
+ static getFirst<T extends MinecraftAsset>(keys: readonly AssetKey[], parser: AssetParser | string): Promise<Maybe<{
788
+ key: AssetKey;
789
+ asset: T;
790
+ }>>;
627
791
  }
628
792
 
629
793
  interface BlockState extends MinecraftAsset {
@@ -638,18 +802,19 @@ interface BlockStateVariant {
638
802
  y?: number;
639
803
  x?: number;
640
804
  uvlock?: boolean;
805
+ weight?: number;
641
806
  }
642
807
  interface BlockStateMultipart {
643
- when?: MultipartCondition | {
644
- OR: MultipartCondition[];
645
- };
646
- apply?: BlockStateVariant;
647
- }
648
- interface MultipartCondition {
649
- [key: string]: string;
808
+ when?: MultipartCondition;
809
+ apply?: BlockStateVariant | BlockStateVariant[];
650
810
  }
811
+ type MultipartCondition = Record<string, string> | {
812
+ OR: MultipartCondition[];
813
+ } | {
814
+ AND: MultipartCondition[];
815
+ };
651
816
 
652
- declare const DEFAULT_ROOT = "https://assets.mcasset.cloud/1.17.1";
817
+ declare const DEFAULT_ROOT = "https://assets.mcasset.cloud/1.21.11";
653
818
  declare const DEFAULT_NAMESPACE = "minecraft";
654
819
  declare class Assets {
655
820
  /**
@@ -674,6 +839,55 @@ type BlockStateProperties = {
674
839
  [key: string]: string;
675
840
  };
676
841
 
842
+ /** One model drawn by a block-entity renderer. */
843
+ interface BlockEntityPart {
844
+ model: string;
845
+ /** Model layer; defaults to "main". */
846
+ layer?: string;
847
+ /** Set only when the texture differs from the layer's default. */
848
+ textureLocation?: string;
849
+ /** Blockstate multipart syntax: every property must match, and "a|b" matches either value. */
850
+ when?: Record<string, string>;
851
+ }
852
+ /** Degrees per property value, or degrees per unit of a numeric property. */
853
+ type BlockEntityRotation = {
854
+ property: string;
855
+ degrees: Record<string, number>;
856
+ } | {
857
+ property: string;
858
+ step: number;
859
+ };
860
+ interface BlockEntityEntry {
861
+ parts: BlockEntityPart[];
862
+ rotation?: BlockEntityRotation;
863
+ /** Offset in model units, applied before the rotation. */
864
+ translation?: TripleArray;
865
+ }
866
+ /** The dataset's `blocks.json`: block ID to the models its block-entity renderer draws. */
867
+ type BlockEntityIndex = MinecraftAsset & {
868
+ [block: string]: BlockEntityEntry;
869
+ };
870
+ interface ResolvedBlockEntity {
871
+ parts: BlockEntityPart[];
872
+ /** Degrees counter-clockwise seen from above, about the block's vertical centre axis. */
873
+ rotation: number;
874
+ translation: TripleArray;
875
+ }
876
+ declare class BlockEntities {
877
+ /**
878
+ * Loads the block index of a version. Versions and sources without one yield an empty index, and so does
879
+ * a failed load: the index is optional, and blocks must not retry or fail with it one by one. The empty
880
+ * result is cached like any other; `Caching.clear()` or `AssetLoader.setVersion()` forces a new attempt.
881
+ */
882
+ static getIndex(root?: string): Promise<BlockEntityIndex>;
883
+ /** The index entry of a block ID such as `minecraft:chest`. */
884
+ static entry(index: BlockEntityIndex, block: string): Maybe<BlockEntityEntry>;
885
+ /** Selects the parts and placement for a block ID such as `minecraft:chest`; undefined when nothing is drawn. */
886
+ static resolve(index: BlockEntityIndex, block: string, state?: BlockStateProperties): Maybe<ResolvedBlockEntity>;
887
+ /** Placement in block space (0..16 per axis), applied on top of the model's own transform. */
888
+ static matrix(resolved: ResolvedBlockEntity, matrix?: Matrix4): Matrix4;
889
+ }
890
+
677
891
  declare class BlockStates {
678
892
  private static _persistentCache;
679
893
  private static get PERSISTENT_CACHE();
@@ -688,25 +902,72 @@ declare class DefaultBlockStates implements MinecraftAsset {
688
902
  [k: string]: BlockStatePropertyDefaults;
689
903
  }
690
904
 
691
- interface EntityModel extends BasicMinecraftAsset {
692
- parts?: {
693
- [p: string]: ModelPart;
694
- };
905
+ /** `entity-models/animations/<namespace>/<model id>.json`: vanilla's keyframe animations of one model. */
906
+ interface EntityAnimationFile extends MinecraftAsset {
907
+ id: string;
908
+ animations: Record<string, EntityAnimation>;
909
+ }
910
+ interface EntityAnimation {
911
+ /** Seconds. */
912
+ length: number;
913
+ loop: boolean;
914
+ /** Part name anywhere in a layer; `root` is the layer's root part. */
915
+ bones: Record<string, EntityAnimationBone>;
695
916
  }
917
+ type EntityAnimationChannel = "position" | "rotation" | "scale";
918
+ /** Keyframes in time order per channel. */
919
+ type EntityAnimationBone = Partial<Record<EntityAnimationChannel, EntityAnimationKeyframe[]>>;
920
+ interface EntityAnimationKeyframe {
921
+ /** Seconds. */
922
+ time: number;
923
+ /** Offset from the default pose: model units, radians, or scale minus one. */
924
+ value: TripleArray;
925
+ /** Value to arrive at when it differs from `value`; linear interpolation only. */
926
+ pre?: TripleArray;
927
+ /** Applies between the previous keyframe and this one. */
928
+ interpolation: "linear" | "catmullrom";
929
+ }
930
+ /** Sampled offsets from the default pose, per bone and channel. */
931
+ type EntityAnimationPose = Record<string, Partial<Record<EntityAnimationChannel, TripleArray>>>;
932
+ declare const ENTITY_ANIMATION_CHANNELS: readonly EntityAnimationChannel[];
933
+ /**
934
+ * Samples one channel like vanilla's `KeyframeAnimation.Entry`: the first value holds before the
935
+ * first keyframe and the last value after the last one; in between, the later keyframe selects the interpolation.
936
+ */
937
+ declare function sampleEntityKeyframes(keyframes: readonly EntityAnimationKeyframe[], time: number): TripleArray;
938
+ /** Elapsed seconds within the animation: modulo `length` when looping, as vanilla does. */
939
+ declare function entityAnimationTime(animation: EntityAnimation, time: number, loop?: boolean): number;
940
+ /** Samples every bone and channel of an animation at `time` seconds. */
941
+ declare function sampleEntityAnimation(animation: EntityAnimation, time: number, loop?: boolean): EntityAnimationPose;
696
942
 
697
943
  declare class Entities {
698
- static getBlockEntityModels(): Promise<Maybe<BlockEntityModels>>;
699
- static getEntityModels(): Promise<Maybe<EntityModels>>;
700
- static getBlockList(): Promise<string[]>;
701
944
  static getEntityList(): Promise<string[]>;
702
- static getBlock(modelKey: BasicAssetKey, textureKey?: BasicAssetKey): Promise<Maybe<EntityModel>>;
703
- static getEntity(modelKey: BasicAssetKey, textureKey?: BasicAssetKey): Promise<Maybe<EntityModel>>;
704
- }
705
- declare class EntityModels implements MinecraftAsset {
706
- [k: string]: any;
945
+ private static getModelFile;
946
+ static getLayerList(modelKey: BasicAssetKey): Promise<string[]>;
947
+ /** The dataset's extra draws on top of `main`; their `when` labels are the states `EntityModelOptions.when` can enable. */
948
+ static getPassList(modelKey: BasicAssetKey): Promise<EntityModelPass[]>;
949
+ static getEntity(modelKey: BasicAssetKey, textureKey?: BasicAssetKey, options?: EntityModelOptions): Promise<Maybe<EntityModel>>;
950
+ /**
951
+ * Vanilla's keyframe animations of a model by name, or undefined when the model or the selected version has none.
952
+ */
953
+ static getAnimations(modelKey: BasicAssetKey): Promise<Maybe<Record<string, EntityAnimation>>>;
954
+ static resolveTexture(modelKey: BasicAssetKey): Promise<Maybe<AssetKey>>;
955
+ /** @deprecated Use getEntityList(); block entities share the entity dataset. */
956
+ static getBlockList(): Promise<string[]>;
957
+ /** @deprecated Use getEntity(); block entities share the entity dataset. */
958
+ static getBlock(modelKey: BasicAssetKey, textureKey?: BasicAssetKey, options?: EntityModelOptions): Promise<Maybe<EntityModel>>;
707
959
  }
708
- declare class BlockEntityModels implements MinecraftAsset {
709
- [k: string]: any;
960
+ interface EntityModelOptions {
961
+ layer?: string;
962
+ /** Layer names in draw order; an explicit selection draws exactly these layers and no dataset passes. */
963
+ layers?: string[];
964
+ /**
965
+ * Entity states that enable the dataset's conditional passes, e.g. `["powered"]` for a charged creeper.
966
+ * Without `layer`/`layers`, `main` and every unconditional pass are always drawn.
967
+ */
968
+ when?: string[];
969
+ /** Per-layer texture overrides, keyed like `EntityModel.layers`. The positional texture key applies to the first selected layer. */
970
+ textures?: Record<string, BasicAssetKey>;
710
971
  }
711
972
 
712
973
  declare class Models {
@@ -714,15 +975,40 @@ declare class Models {
714
975
  private static get PERSISTENT_CACHE();
715
976
  static getItemList(): Promise<string[]>;
716
977
  static loadAndMerge(key: AssetKey): Promise<Maybe<Model>>;
978
+ private static getItemModel;
979
+ private static defaultItemModel;
717
980
  static getRaw(key: AssetKey): Promise<Maybe<Model>>;
718
981
  static getMerged(key: AssetKey): Promise<Maybe<Model>>;
719
982
  static get(key: AssetKey): Promise<Maybe<Model>>;
720
983
  static clearCache(): Promise<void>;
721
984
  }
722
985
 
986
+ declare class DisplayTransforms {
987
+ /** Resolve hand fallbacks within one model, before inheriting parent display entries. */
988
+ static withHandFallbacks(display: Model["display"]): Model["display"];
989
+ /** Build a display pose for geometry already centered at the model's [8, 8, 8] pivot. */
990
+ static getMatrix(display: Model["display"], position: DisplayPosition): Matrix4;
991
+ static apply(geometry: BufferGeometry, matrix: Matrix4): void;
992
+ }
993
+
994
+ declare class ItemTints {
995
+ /** Resolves preview colors from item definitions; explicit per-index colors take precedence. */
996
+ static get(model: Model, tints?: Record<number, number>): Promise<Record<number, number> | undefined>;
997
+ private static rgb;
998
+ }
999
+
1000
+ declare class ModelCulling {
1001
+ static toLocalMask(worldMask: number, rotation: Euler): number;
1002
+ static isOpaqueFullCube(atlas: Maybe<TextureAtlas>): boolean;
1003
+ }
1004
+
723
1005
  declare class ModelGenerator {
724
1006
  static readonly ITEM_LAYERS: string[];
725
- static generateItemModel(imageData: ImageData$1, layer: string): ModelElement[];
1007
+ /**
1008
+ * Front and back faces plus one zero-thickness side face per run of texels that border a transparent texel,
1009
+ * like vanilla's ItemModelGenerator. Pass the pixels of a single (first) animation frame.
1010
+ */
1011
+ static generateItemModel(imageData: Pick<ImageData$1, "width" | "height" | "data">, layer: string): ModelElement[];
726
1012
  }
727
1013
 
728
1014
  declare class ModelMerger {
@@ -730,14 +1016,41 @@ declare class ModelMerger {
730
1016
  protected static collectAllParents(model: Model): Promise<Model[]>;
731
1017
  }
732
1018
 
1019
+ interface SpecialItemPart {
1020
+ model: EntityModel;
1021
+ transform: Matrix4;
1022
+ rotations: Record<string, TripleArray>;
1023
+ }
1024
+ declare class SpecialItems {
1025
+ /** Resolves the static entity parts drawn by a special item renderer, in model units. */
1026
+ static getParts(special: SpecialItemRenderer, root?: string): Promise<SpecialItemPart[]>;
1027
+ /** An owned material with model-preview shading; its entity texture remains shared. */
1028
+ static createMaterial(source: MeshBasicMaterial, shade: boolean): MeshBasicMaterial;
1029
+ }
1030
+
733
1031
  interface Block {
734
1032
  type: string;
735
1033
  properties?: BlockStateProperties;
736
1034
  nbt?: any;
737
1035
  }
738
1036
 
1037
+ declare class BlockStateResolver {
1038
+ static defaults(blockState: BlockState): Promise<BlockStateProperties>;
1039
+ static select(blockState: BlockState, state: BlockStateProperties, choose?: (variants: BlockStateVariant | BlockStateVariant[]) => BlockStateVariant): BlockStateVariant[];
1040
+ static matching(blockState: BlockState, state: BlockStateProperties): (BlockStateVariant | BlockStateVariant[])[];
1041
+ static choose(variants: BlockStateVariant | BlockStateVariant[]): BlockStateVariant;
1042
+ static rotation(variant: BlockStateVariant): Euler;
1043
+ }
1044
+
1045
+ declare class BlockTints {
1046
+ /** Resolves block preview colors without biome context; explicit tints take precedence. */
1047
+ static get(key: AssetKey | undefined, state: BlockStateProperties, model: Model, tints?: Record<number, number>): Promise<Record<number, number> | undefined>;
1048
+ }
1049
+
739
1050
  interface Instanceable {
740
1051
  nextInstance(): InstanceReference<SceneObject>;
1052
+ removeInstanceAt(index: number): void;
1053
+ isInstanceActive(index: number, reference: InstanceReference<Instanceable>): boolean;
741
1054
  getMatrixAt(index: number, matrix?: Matrix4): Matrix4;
742
1055
  setMatrixAt(index: number, matrix: Matrix4): void;
743
1056
  setPositionRotationScaleAt(index: number, position?: Vector3, rotation?: Euler, scale?: Vector3): void;
@@ -750,12 +1063,15 @@ interface Instanceable {
750
1063
  }
751
1064
  declare function isInstanceable(obj: any): obj is Instanceable;
752
1065
 
753
- declare class InstanceReference<T extends Instanceable> implements Transformable {
1066
+ declare class InstanceReference<T extends Instanceable> implements Transformable, Disposable {
754
1067
  readonly instanceable: T;
755
1068
  readonly index: number;
756
1069
  readonly isInstanceReference: true;
757
1070
  constructor(instanceable: T, index: number);
758
1071
  nextInstance(): InstanceReference<SceneObject>;
1072
+ private get activeInstanceable();
1073
+ removeFromScene(): void;
1074
+ dispose(): void;
759
1075
  getMatrix(matrix?: Matrix4): Matrix4;
760
1076
  setMatrix(matrix: Matrix4): void;
761
1077
  setPositionRotationScale(position?: Vector3, rotation?: Euler, scale?: Vector3): void;
@@ -780,18 +1096,34 @@ declare class ModelObject extends SceneObject {
780
1096
  readonly isModelObject: true;
781
1097
  static readonly DEFAULT_OPTIONS: ModelObjectOptions;
782
1098
  readonly options: ModelObjectOptions;
783
- private atlas?;
1099
+ protected atlas?: TextureAtlas;
1100
+ private atlasMaterial?;
1101
+ private atlasTexture?;
1102
+ private unsubscribeAtlas?;
1103
+ private readonly specialMaterials;
784
1104
  blockParent: Maybe<BlockObject>;
785
1105
  private meshesCreated;
786
1106
  constructor(originalModel: Model, options?: Partial<ModelObjectOptions>);
787
1107
  init(): Promise<void>;
788
- dispose(): void;
789
1108
  get textureAtlas(): Maybe<TextureAtlas>;
1109
+ get isOpaqueFullCube(): boolean;
790
1110
  protected loadTextures(): Promise<void>;
791
1111
  protected createMeshes(force?: boolean): void;
792
1112
  protected applyTextures(): void;
1113
+ private updateAnimationSubscription;
1114
+ nextInstance(): InstanceReference<SceneObject>;
1115
+ removeInstanceAt(index: number): void;
1116
+ disposeAndRemoveAllChildren(): void;
793
1117
  }
794
1118
  interface ModelObjectOptions extends SceneObjectOptions {
1119
+ /** Minecraft display pose applied around the model center, before scene transforms. */
1120
+ displayPosition?: DisplayPosition;
1121
+ /** Quarter-turn block rotation in radians to compensate when locking UVs. */
1122
+ uvLockRotation?: TripleArray;
1123
+ /** sRGB 0xRRGGBB colors by face tint index; omitted indices stay white. */
1124
+ tints?: Record<number, number>;
1125
+ /** Hidden neighbor directions in CUBE_FACES order, before the model's block rotation. */
1126
+ cullMask?: number;
795
1127
  }
796
1128
  declare function isModelObject(obj: any): obj is ModelObject;
797
1129
 
@@ -824,24 +1156,71 @@ declare enum SkinPart {
824
1156
  }
825
1157
  declare const SKIN_PARTS: SkinPart[];
826
1158
 
1159
+ type CapeLayout = "minecraft" | "optifine" | "labymod";
1160
+ declare const capeTextureSizes: Record<CapeLayout, DoubleArray>;
1161
+
1162
+ /** A player model facing +Z. Left and right parts are the player's own: left is +X, right is -X. */
827
1163
  declare class SkinObject extends SceneObject {
828
1164
  readonly options: SkinObjectOptions;
829
1165
  private slim;
830
- private legacy;
1166
+ private detectedSlim;
831
1167
  private skinTextureSrc?;
832
- private skinTextureWidth;
833
- private skinTextureHeight;
834
- private capeTextureSrc?;
1168
+ private skinMaterial?;
1169
+ private skinLoad;
1170
+ private capeLoad;
835
1171
  constructor(options?: DeepPartial<SkinObjectOptions>);
836
1172
  init(): Promise<void>;
837
1173
  protected removeMeshes(): void;
838
1174
  protected createMeshes(): void;
839
- setSkinTexture(src: string): void;
840
- setSlim(slim: boolean): void;
841
- setLegacy(legacy: boolean): void;
1175
+ setSkinTexture(src: string): Promise<void>;
1176
+ /** Load a cape texture in the selected layout, or pass undefined to remove the cape. */
1177
+ setCapeTexture(src?: string, layout?: CapeLayout): Promise<void>;
1178
+ /** Select the arm model, or pass undefined to use texture detection. */
1179
+ setSlim(slim?: boolean): void;
1180
+ private updateSlim;
1181
+ /** Select the texture layout, or pass undefined to detect it from image dimensions. */
1182
+ setLegacy(legacy?: boolean): Promise<void>;
1183
+ dispose(): void;
842
1184
  protected getBoxGeometry(part: SkinPart): BoxGeometry;
843
1185
  }
844
1186
  interface SkinObjectOptions extends SceneObjectOptions {
1187
+ slim?: boolean;
1188
+ legacy?: boolean;
1189
+ }
1190
+
1191
+ interface EntityAnimationOptions {
1192
+ /** Overrides the animation's own `loop` flag. */
1193
+ loop?: boolean;
1194
+ /** Playback rate applied to advanced time; defaults to 1. */
1195
+ speed?: number;
1196
+ /** Start time in seconds; defaults to 0. */
1197
+ time?: number;
1198
+ }
1199
+ /**
1200
+ * Poses part groups from a keyframe animation the way vanilla does: every update restores the
1201
+ * default pose of each animated part, then adds the sampled offsets to its position, Euler angles and scale.
1202
+ * It owns no timer; the owner advances it.
1203
+ */
1204
+ declare class EntityAnimationPlayer {
1205
+ private parts;
1206
+ private _animation?;
1207
+ private _time;
1208
+ private loop;
1209
+ private speed;
1210
+ get animation(): EntityAnimation | undefined;
1211
+ get time(): number;
1212
+ /**
1213
+ * Starts an animation on the named parts below each layer root. The current pose of a part becomes its default;
1214
+ * bones without a matching part are skipped.
1215
+ */
1216
+ play(layers: Object3D[], animation: EntityAnimation, options?: EntityAnimationOptions): void;
1217
+ /** Restores the default poses. Returns whether an animation was active. */
1218
+ stop(): boolean;
1219
+ /** Forgets the animation without touching the parts, for parts that no longer exist. */
1220
+ clear(): void;
1221
+ setTime(seconds: number): boolean;
1222
+ advance(deltaSeconds: number): boolean;
1223
+ private apply;
845
1224
  }
846
1225
 
847
1226
  declare class EntityObject extends SceneObject {
@@ -849,19 +1228,99 @@ declare class EntityObject extends SceneObject {
849
1228
  readonly isEntityObject: true;
850
1229
  static readonly DEFAULT_OPTIONS: EntityObjectOptions;
851
1230
  readonly options: EntityObjectOptions;
852
- private imageData?;
853
1231
  private meshesCreated;
1232
+ private readonly geometries;
1233
+ private readonly disposeWireframes;
1234
+ /** Scrolling materials are owned: their texture offset follows this entity's age. */
1235
+ private readonly scrollMaterials;
1236
+ private scrollTicker;
1237
+ /** Entity age in ticks, as vanilla's `ageInTicks`; drives the scrolling render modes. */
1238
+ age: number;
1239
+ private readonly animationPlayer;
854
1240
  constructor(entity: EntityModel, options?: Partial<EntityObjectOptions>);
855
1241
  init(): Promise<void>;
856
1242
  dispose(): void;
857
- protected loadTextures(): Promise<void>;
1243
+ disposeAndRemoveAllChildren(): void;
1244
+ private clearScrollMaterials;
1245
+ private updateScrollSubscription;
1246
+ /** Applies the entity age to the scrolling materials; the ticker calls this 20 times per second. */
1247
+ private updateScroll;
1248
+ /** The animation started by {@link playAnimation}, until {@link stopAnimation} or disposal. */
1249
+ get animation(): Maybe<EntityAnimation>;
1250
+ /** Seconds since the animation started, before looping. */
1251
+ get animationTime(): number;
1252
+ /**
1253
+ * Poses the object from a keyframe animation of {@link Entities.getAnimations}, replacing the current one.
1254
+ * Parts of every layer are matched by name and their current pose is the default the offsets add to.
1255
+ * The object owns no clock: call {@link advanceAnimation} per frame, or {@link setAnimationTime}.
1256
+ */
1257
+ playAnimation(animation: EntityAnimation, options?: EntityAnimationOptions): void;
1258
+ /** Stops the animation and restores the default pose. */
1259
+ stopAnimation(): void;
1260
+ /** Poses the object at an explicit time in seconds. Has no effect without an animation. */
1261
+ setAnimationTime(seconds: number): void;
1262
+ /** Advances the animation by a frame delta in seconds, scaled by its speed. Has no effect without an animation. */
1263
+ advanceAnimation(deltaSeconds: number): void;
1264
+ getLayerGroup(name: string): Maybe<Object3D>;
1265
+ getGroupByName(name: string, layerName?: string): Maybe<Object3D>;
1266
+ getMeshByName(name: string, layerName?: string): Maybe<Mesh>;
1267
+ private get entityLayers();
1268
+ private getTextureKey;
1269
+ protected loadTextures(layer?: EntityLayer): Promise<Maybe<ExtractableImageData>>;
858
1270
  protected createMeshes(force?: boolean): void;
1271
+ private createPart;
859
1272
  protected applyTextures(): Promise<void>;
860
1273
  }
861
1274
  interface EntityObjectOptions extends SceneObjectOptions {
1275
+ /**
1276
+ * `true` applies only vanilla's entity flip, scale (-1, -1, 1); `false` keeps raw model space.
1277
+ * By default the model's dataset transform is used, or the flip for models without one.
1278
+ */
1279
+ flip?: boolean;
1280
+ /** Colours for the dataset's tint labels, e.g. `{ wool_color: 0xf9801d }`; a pass whose label is absent stays untinted. */
1281
+ tints?: Record<string, ColorRepresentation>;
862
1282
  }
863
1283
  declare function isEntityObject(obj: any): obj is EntityObject;
864
1284
 
1285
+ /** GUI layers use pixel coordinates. Later layers draw above earlier layers. */
1286
+ type GuiLayer = GuiTextureLayer | GuiItemLayer;
1287
+ interface GuiLayerLayout {
1288
+ name?: string;
1289
+ /** Top-left position; x grows right and y grows down. Defaults to [0, 0]. */
1290
+ position?: [number, number];
1291
+ /** Output width and height; defaults to the texture crop size or [16, 16] for items. */
1292
+ size?: [number, number];
1293
+ }
1294
+ interface GuiTextureLayer extends GuiLayerLayout {
1295
+ texture: AssetKey | string;
1296
+ /** Source-image pixels: [x, y, width, height], measured from the top left. */
1297
+ crop?: [number, number, number, number];
1298
+ }
1299
+ interface GuiItemLayer extends GuiLayerLayout {
1300
+ /** Model key, such as minecraft:item/stone; uses the model's GUI display pose. */
1301
+ item: AssetKey | string;
1302
+ /** sRGB 0xRRGGBB colors by face tint index; omitted indices stay white. */
1303
+ tints?: Record<number, number>;
1304
+ }
1305
+
1306
+ declare class GuiObject extends SceneObject {
1307
+ readonly textureLayers: readonly GuiLayer[];
1308
+ readonly isGuiObject: true;
1309
+ /** Local bounds in GUI pixels, with y growing down from the origin. */
1310
+ readonly bounds: Box2;
1311
+ private readonly geometries;
1312
+ private readonly ownedMaterials;
1313
+ private initialized;
1314
+ constructor(textureLayers: readonly GuiLayer[], options?: Partial<GuiObjectOptions>);
1315
+ init(): Promise<void>;
1316
+ private createItem;
1317
+ private loadMaterial;
1318
+ disposeAndRemoveAllChildren(): void;
1319
+ }
1320
+ interface GuiObjectOptions extends SceneObjectOptions {
1321
+ }
1322
+ declare function isGuiObject(obj: any): obj is GuiObject;
1323
+
865
1324
  declare class MineRenderScene extends Scene {
866
1325
  readonly isMineRenderScene: true;
867
1326
  static readonly DEFAULT_OPTIONS: MineRenderSceneOptions;
@@ -881,6 +1340,7 @@ declare class MineRenderScene extends Scene {
881
1340
  addBlock(blockState: BlockState, options?: Partial<BlockObjectOptions>, parent?: Object3D): Promise<BlockObject | InstanceReference<BlockObject>>;
882
1341
  addSkin(skin?: string, options?: Partial<SkinObjectOptions>, parent?: Object3D): Promise<SkinObject>;
883
1342
  addEntity(entity: EntityModel, options?: Partial<EntityObjectOptions>, parent?: Object3D): Promise<EntityObject | InstanceReference<EntityObject>>;
1343
+ addGui(layers: readonly GuiLayer[], options?: Partial<GuiObjectOptions>, parent?: Object3D): Promise<GuiObject>;
884
1344
  }
885
1345
  interface MineRenderSceneOptions {
886
1346
  }
@@ -896,6 +1356,9 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
896
1356
  private materialCallbacks;
897
1357
  protected _isInstanced: boolean;
898
1358
  _instanceCounter: number;
1359
+ protected instanceMesh?: InstancedMesh;
1360
+ private readonly instanceReferences;
1361
+ private readonly freeInstanceIndices;
899
1362
  constructor(options?: Partial<SceneObjectOptions>);
900
1363
  set scene(scene: MineRenderScene);
901
1364
  get scene(): MineRenderScene;
@@ -935,6 +1398,12 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
935
1398
  get instanceCounter(): number;
936
1399
  protected constructInstanceReference(i: number): InstanceReference<SceneObject>;
937
1400
  nextInstance(): InstanceReference<SceneObject>;
1401
+ /** Returns the live reference for a raycast hit on this object's instance mesh. */
1402
+ getInstanceReference(mesh: Object3D, index: number): Maybe<InstanceReference<SceneObject>>;
1403
+ isInstanceActive(index: number, reference: InstanceReference<Instanceable>): boolean;
1404
+ removeInstanceAt(index: number): void;
1405
+ private growInstances;
1406
+ protected activeInstanceIndices(): Iterable<number>;
938
1407
  getMatrixAt(index: number, matrix?: Matrix4): Matrix4;
939
1408
  setMatrixAt(index: number, matrix: Matrix4): void;
940
1409
  setPositionRotationScaleAt(index: number, position?: Vector3, rotation?: Euler, scale?: Vector3): void;
@@ -958,6 +1427,23 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
958
1427
  }
959
1428
  declare function isSceneObject(obj: any): obj is SceneObject;
960
1429
 
1430
+ type FluidKind = "water" | "lava";
1431
+ interface BlockFluidState {
1432
+ kind: FluidKind;
1433
+ level: number;
1434
+ renderModel: boolean;
1435
+ }
1436
+ declare function getBlockFluidState(key?: AssetKey, state?: BlockStateProperties): BlockFluidState | undefined;
1437
+ declare function getFluidKind(key?: AssetKey, state?: BlockStateProperties): FluidKind | undefined;
1438
+ interface FluidSample {
1439
+ fluid?: FluidKind;
1440
+ level?: number;
1441
+ solid?: boolean;
1442
+ }
1443
+ type FluidSampler = (x: number, y: number, z: number) => FluidSample;
1444
+ /** Builds centered fluid faces with material groups 0 (still) and 1 (flowing). */
1445
+ declare function createFluidGeometry(kind: FluidKind, sample: FluidSampler): BufferGeometry;
1446
+
961
1447
  declare class BlockObject extends SceneObject {
962
1448
  readonly blockState: BlockState;
963
1449
  readonly isBlockObject: true;
@@ -971,16 +1457,43 @@ declare class BlockObject extends SceneObject {
971
1457
  private _instanceModel;
972
1458
  private _variants;
973
1459
  private _models;
1460
+ private _cullMask;
1461
+ private _fluidKey?;
1462
+ private _fluidSampler?;
1463
+ private _fluidModel?;
1464
+ private _entities;
1465
+ private _entityPlacement;
1466
+ private _entityGeneration;
974
1467
  constructor(blockState: BlockState, options?: Partial<BlockObjectOptions>);
975
1468
  init(): Promise<void>;
976
1469
  dispose(): void;
977
1470
  removeFromScene(): void;
1471
+ private clearModels;
1472
+ private removeModels;
1473
+ private removeEntities;
1474
+ /** Entity models drawn for this block instead of its block model; they are scene children, unlike the block. */
1475
+ get blockEntities(): readonly EntityObject[];
1476
+ /**
1477
+ * Draws the block through the dataset's block-entity index. Returns false, leaving nothing behind,
1478
+ * when the block is not listed or one of its models cannot be loaded.
1479
+ */
1480
+ private createBlockEntities;
1481
+ private placeEntities;
1482
+ get isOccluding(): boolean;
1483
+ private getModelMatrix;
1484
+ private getModelCullMask;
1485
+ setCullMask(worldMask: number): Promise<void>;
978
1486
  get state(): {
979
1487
  [key: string]: string;
980
1488
  };
1489
+ get fluidKind(): FluidKind | undefined;
1490
+ get fluidLevel(): number;
1491
+ /** Refreshes fluid surfaces from relative neighbors; standalone previews use air around the block. */
1492
+ updateFluid(sample?: FluidSampler): Promise<void>;
981
1493
  nextInstance(): InstanceReference<SceneObject>;
982
1494
  protected mapStateToVariant(state: BlockStateProperties): Promise<BlockStateVariant[]>;
983
1495
  recreateModels(): Promise<void>;
1496
+ private hasGeometry;
984
1497
  protected getSingleVariant(variants: BlockStateVariant | BlockStateVariant[]): BlockStateVariant;
985
1498
  protected createAVariant(variants: BlockStateVariant | BlockStateVariant[], instanceInfo: Matrix4[]): Promise<void>;
986
1499
  protected createVariant(variant: BlockStateVariant): Promise<ModelObject | InstanceReference<ModelObject>>;
@@ -996,26 +1509,50 @@ declare class BlockObject extends SceneObject {
996
1509
  }
997
1510
  interface BlockObjectOptions extends ModelObjectOptions {
998
1511
  applyDefaultState: boolean;
1512
+ /** Properties applied before model creation, overriding defaults when applyDefaultState is enabled. */
1513
+ initialState?: BlockStateProperties;
999
1514
  }
1000
1515
  declare function isBlockObject(obj: any): obj is BlockObject;
1001
1516
 
1517
+ /** Saved fluid levels and solid neighbors determine the geometry shared by an instance pool. */
1518
+ declare function sampleFluid(kind: FluidKind, sample: FluidSampler): {
1519
+ key: string;
1520
+ sample: FluidSampler;
1521
+ };
1522
+ declare class FluidModelObject extends ModelObject {
1523
+ readonly kind: FluidKind;
1524
+ private readonly sample;
1525
+ private geometry?;
1526
+ constructor(kind: FluidKind, sample: FluidSampler, origin?: AssetKey, options?: Partial<ModelObjectOptions>);
1527
+ protected createMeshes(): void;
1528
+ protected applyTextures(): void;
1529
+ disposeAndRemoveAllChildren(): void;
1530
+ }
1531
+
1002
1532
  interface MultiBlockStructure {
1003
1533
  readonly size: TripleArray;
1004
1534
  readonly blocks: MultiBlockBlock[];
1535
+ readonly dataVersion?: number;
1536
+ readonly entities?: MultiBlockEntity[];
1537
+ }
1538
+ interface MultiBlockEntity {
1539
+ position: TripleArray;
1540
+ blockPosition?: TripleArray;
1541
+ nbt: unknown;
1005
1542
  }
1006
1543
  interface MultiBlockBlock extends Block {
1007
1544
  position: TripleArray;
1008
1545
  }
1009
1546
 
1010
1547
  declare class SchematicParser {
1011
- static parse(): Promise<MultiBlockStructure>;
1548
+ static parse(nbt: NBT): Promise<MultiBlockStructure>;
1012
1549
  }
1013
1550
 
1014
1551
  declare class StructureParser {
1015
1552
  static parse(_nbt: NBT, paletteIndex?: number): Promise<MultiBlockStructure>;
1016
1553
  }
1017
1554
  interface StructureNBT {
1018
- DataVersion: {
1555
+ DataVersion?: {
1019
1556
  type: "int";
1020
1557
  value: number;
1021
1558
  };
@@ -1027,7 +1564,13 @@ interface StructureNBT {
1027
1564
  };
1028
1565
  };
1029
1566
  palette?: Palette;
1030
- palettes?: Palette[];
1567
+ palettes?: {
1568
+ type: "list";
1569
+ value: {
1570
+ type: "list";
1571
+ value: Palette["value"][];
1572
+ };
1573
+ };
1031
1574
  blocks: {
1032
1575
  type: "list";
1033
1576
  value: {
@@ -1035,7 +1578,32 @@ interface StructureNBT {
1035
1578
  value: BlockEntry[];
1036
1579
  };
1037
1580
  };
1038
- entities: {};
1581
+ entities?: {
1582
+ type: "list";
1583
+ value: {
1584
+ type: "compound";
1585
+ value: {
1586
+ pos: {
1587
+ type: "list";
1588
+ value: {
1589
+ type: "double";
1590
+ value: TripleArray;
1591
+ };
1592
+ };
1593
+ blockPos: {
1594
+ type: "list";
1595
+ value: {
1596
+ type: "int";
1597
+ value: TripleArray;
1598
+ };
1599
+ };
1600
+ nbt: {
1601
+ type: "compound";
1602
+ value: any;
1603
+ };
1604
+ }[];
1605
+ };
1606
+ };
1039
1607
  }
1040
1608
  interface Palette {
1041
1609
  type: "list";
@@ -1079,14 +1647,17 @@ interface BlockEntry {
1079
1647
  }
1080
1648
 
1081
1649
  declare class NBTHelper {
1082
- static fromBuffer(buffer: Buffer): Promise<NBTAsset>;
1650
+ static fromBuffer(data: Uint8Array | ArrayBuffer, format?: NBTFormat): Promise<NBTAsset>;
1083
1651
  }
1084
1652
  interface NBTAsset extends MinecraftAsset, NBT {
1653
+ format?: NBTFormat;
1654
+ metadata?: Metadata;
1655
+ compression?: "gzip" | "none";
1085
1656
  }
1086
1657
 
1087
1658
  interface ResponseParser<T extends MinecraftAsset> {
1088
- config(request: AxiosRequestConfig): any;
1089
- parse(response: AxiosResponse): Maybe<T> | Promise<Maybe<T>>;
1659
+ config(request: RequestConfig): any;
1660
+ parse(response: RequestResponse): Maybe<T> | Promise<Maybe<T>>;
1090
1661
  }
1091
1662
 
1092
1663
  declare class HostedAssetSource extends AssetSource {
@@ -1105,6 +1676,7 @@ declare class HostedAssetSource extends AssetSource {
1105
1676
  private readonly _options;
1106
1677
  constructor(root: string, options?: Partial<HostedAssetSourceOptions>);
1107
1678
  get root(): string;
1679
+ get cacheId(): string;
1108
1680
  get options(): HostedAssetSourceOptions;
1109
1681
  get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser): Promise<Maybe<T>>;
1110
1682
  }
@@ -1119,6 +1691,8 @@ interface ArchiveEntry {
1119
1691
  }
1120
1692
 
1121
1693
  interface ArchiveProxy {
1694
+ /** Identifies the archive's content across sessions; undefined when it cannot be identified. */
1695
+ readonly id?: string;
1122
1696
  getEntries(): Promise<ArchiveEntry[]>;
1123
1697
  }
1124
1698
 
@@ -1126,6 +1700,7 @@ declare class ArchiveAssetSource extends AssetSource implements ArchiveProxy {
1126
1700
  readonly _archiveProxy: ArchiveProxy;
1127
1701
  constructor(archiveProxy: ArchiveProxy);
1128
1702
  static blob(blob: Blob): ArchiveAssetSource;
1703
+ get cacheId(): Maybe<string>;
1129
1704
  getEntries(): Promise<ArchiveEntry[]>;
1130
1705
  getEntry(path: string): Promise<Maybe<ArchiveEntry>>;
1131
1706
  get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
@@ -1136,7 +1711,8 @@ declare class ArchiveAssetSource extends AssetSource implements ArchiveProxy {
1136
1711
  declare class BrowserArchiveProxy implements ArchiveProxy {
1137
1712
  readonly _blob: Blob;
1138
1713
  readonly _reader: ZipReader<Blob>;
1139
- constructor(blob: Blob);
1714
+ readonly id?: string;
1715
+ constructor(blob: Blob, id?: string);
1140
1716
  getEntries(): Promise<ArchiveEntry[]>;
1141
1717
  }
1142
1718
 
@@ -1214,27 +1790,84 @@ declare class Caching {
1214
1790
  static readonly mergedModelCache: AsyncLoadingCache<CacheKey, Model>;
1215
1791
  static readonly modelTextureAtlasCache: AsyncLoadingCache<CacheKey, TextureAtlas>;
1216
1792
  static readonly blockStateCache: AsyncLoadingCache<CacheKey, BlockState>;
1793
+ static readonly listAssetCache: AsyncLoadingCache<CacheKey, ListAsset>;
1794
+ static readonly defaultBlockStatesCache: AsyncLoadingCache<CacheKey, DefaultBlockStates>;
1795
+ static readonly blockTintCache: AsyncLoadingCache<CacheKey, number>;
1796
+ static readonly entityModelCache: AsyncLoadingCache<CacheKey, EntityModelFile>;
1797
+ static readonly entityTextureCache: AsyncLoadingCache<CacheKey, AssetKey>;
1798
+ static readonly entityAnimationCache: AsyncLoadingCache<CacheKey, EntityAnimationFile>;
1799
+ static readonly blockEntityIndexCache: AsyncLoadingCache<CacheKey, BlockEntityIndex>;
1800
+ private static createAssetCache;
1217
1801
  /** Every cache above, so clear()/end() can never fall out of sync with the field list again. */
1218
1802
  private static get all();
1219
1803
  static clear(): void;
1220
1804
  /**
1221
1805
  * Clears every cache and stops its expiry timer.
1222
1806
  *
1223
- * loading-cache reschedules that timer indefinitely, so a Node process will not exit until
1224
- * this is called - see {@link shutdown}.
1807
+ * Expiry timers are unref'd in Node, so idle processes can exit without this cleanup.
1808
+ * Use {@link shutdown} to also stop requests and the shared Ticker.
1225
1809
  */
1226
1810
  static end(): void;
1227
1811
  static get cacheSizes(): {};
1228
1812
  }
1229
1813
 
1814
+ /** Copies the nontransparent bounds without resizing the source; empty images become one transparent pixel. */
1815
+ declare function trimCanvas(source: CompatCanvas): CompatCanvas;
1816
+
1230
1817
  declare class MineRenderError extends Error {
1231
1818
  constructor(msg: any);
1232
1819
  get name(): string;
1233
1820
  }
1234
1821
 
1235
- declare class GuiObject extends SceneObject {
1822
+ interface SceneGLTFExportOptions {
1823
+ /** Returns a GLB ArrayBuffer instead of a glTF object. */
1824
+ binary?: boolean;
1825
+ /** Maximum width and height of each exported texture, in pixels. */
1826
+ maxTextureSize?: number;
1236
1827
  }
1237
- interface GuiObjectOptions extends SceneObjectOptions {
1828
+ /** Exports the visible meshes at their current poses without changing the source scene. */
1829
+ declare class SceneExporter {
1830
+ /** Returns OBJ geometry with normals and UVs; material files and textures are not included. */
1831
+ static toObj(root: Object3D): string;
1832
+ /** Returns PLY geometry with vertex colors and UVs; texture images are not included. */
1833
+ static toPLY(root: Object3D, options?: PLYExporterOptions): string | ArrayBuffer;
1834
+ /**
1835
+ * Exports a static glTF/GLB snapshot in a browser. Atlas textures and vertex tints are retained;
1836
+ * MineRender's custom directional lighting is not baked into the exported materials.
1837
+ */
1838
+ static toGLTF(root: Object3D, options?: SceneGLTFExportOptions): Promise<Record<string, any> | ArrayBuffer>;
1839
+ }
1840
+
1841
+ declare class GuiHelper {
1842
+ static inventorySlot(slot: number | [number, number], origin?: [number, number], offset?: [number, number], rowSize?: number): [number, number];
1843
+ /** Creates crafting-table layers for ingredients and the result; stack counts are not drawn. */
1844
+ static recipe(recipe: GuiRecipe, options?: GuiRecipeOptions): GuiLayer[];
1845
+ }
1846
+ type GuiRecipeIngredientValue = string | {
1847
+ item: string;
1848
+ } | {
1849
+ tag: string;
1850
+ };
1851
+ type GuiRecipeIngredient = GuiRecipeIngredientValue | readonly GuiRecipeIngredientValue[];
1852
+ type GuiRecipe = ({
1853
+ type: "minecraft:crafting_shaped" | "crafting_shaped";
1854
+ pattern: readonly string[];
1855
+ key: Readonly<Record<string, GuiRecipeIngredient>>;
1856
+ } | {
1857
+ type: "minecraft:crafting_shapeless" | "crafting_shapeless";
1858
+ ingredients: readonly GuiRecipeIngredient[];
1859
+ }) & {
1860
+ result: {
1861
+ id: string;
1862
+ count?: number;
1863
+ } | {
1864
+ item: string;
1865
+ count?: number;
1866
+ };
1867
+ };
1868
+ interface GuiRecipeOptions {
1869
+ /** Selects a concrete item ID or model AssetKey for a tag or alternatives array. */
1870
+ resolveIngredient?: (ingredient: GuiRecipeIngredient) => string | AssetKey;
1238
1871
  }
1239
1872
 
1240
1873
  declare class OrbitControls {
@@ -1329,7 +1962,10 @@ declare class Renderer implements Disposable {
1329
1962
  protected _frameInterval?: number;
1330
1963
  protected _resizeListener?: () => void;
1331
1964
  private _nextFrameTime?;
1965
+ private _running;
1966
+ private _inAnimationLoop;
1332
1967
  private _disposed;
1968
+ private readonly _frameCallbacks;
1333
1969
  private readonly _debugHelpers;
1334
1970
  private readonly _eventDispatchers;
1335
1971
  private readonly _changeListener;
@@ -1350,6 +1986,12 @@ declare class Renderer implements Disposable {
1350
1986
  resize(width: number, height: number): void;
1351
1987
  get dirty(): boolean;
1352
1988
  set dirty(dirty: boolean);
1989
+ /**
1990
+ * Calls a synchronous animation update before each FPS-limited draw while started.
1991
+ * Subscriptions keep the scene drawing without manual dirty flags. Returns an unsubscribe function.
1992
+ * Registering the same callback twice has no effect. Image exports do not invoke callbacks.
1993
+ */
1994
+ onFrame(callback: FrameCallback): () => void;
1353
1995
  start(): void;
1354
1996
  stop(): void;
1355
1997
  /**
@@ -1359,7 +2001,16 @@ declare class Renderer implements Disposable {
1359
2001
  */
1360
2002
  dispose(): void;
1361
2003
  private animate;
1362
- toImage(): string;
2004
+ private drawFrame;
2005
+ /**
2006
+ * Renders a fresh frame and returns an image data URL, including while the animation loop is stopped.
2007
+ * Trimming removes transparent borders; an empty image becomes one transparent pixel.
2008
+ * MIME type support and lossy quality (0–1) follow the canvas encoder.
2009
+ */
2010
+ toImage(trim?: boolean, mime?: string, quality?: number): string;
2011
+ toObj(): string;
2012
+ toPLY(options?: PLYExporterOptions): string | ArrayBuffer;
2013
+ toGLTF(options?: SceneGLTFExportOptions): Promise<Record<string, any> | ArrayBuffer>;
1363
2014
  protected get attachedToBody(): boolean;
1364
2015
  protected get viewWidth(): number;
1365
2016
  protected get viewHeight(): number;
@@ -1370,6 +2021,13 @@ declare class Renderer implements Disposable {
1370
2021
  /** Renderer-owned controls, or undefined when disabled at construction or after disposal. */
1371
2022
  get controls(): Maybe<OrbitControls>;
1372
2023
  }
2024
+ interface RendererFrame {
2025
+ /** Animation-loop timestamp in seconds, relative to the browser's performance time origin. */
2026
+ readonly time: number;
2027
+ /** Seconds since this callback's previous update; zero on its first update after subscribing or starting. */
2028
+ readonly delta: number;
2029
+ }
2030
+ type FrameCallback = (frame: RendererFrame) => void;
1373
2031
  interface RendererOptions {
1374
2032
  camera: CameraOptions;
1375
2033
  render: RenderOptions;
@@ -1397,6 +2055,8 @@ interface CameraOptions {
1397
2055
  interface RenderOptions {
1398
2056
  /** Maximum draw rate (60 by default); zero or a negative value disables the limit. */
1399
2057
  fpsLimit: number;
2058
+ /** Drawing-buffer pixels per CSS pixel (default 1); also scales toImage() output. */
2059
+ pixelRatio?: number;
1400
2060
  stats: boolean;
1401
2061
  antialias: boolean;
1402
2062
  shade: boolean;
@@ -1421,17 +2081,21 @@ declare class SceneInspector {
1421
2081
  protected readonly raycaster: Raycaster;
1422
2082
  private readonly mouse;
1423
2083
  private selectedObject?;
2084
+ private pointer?;
2085
+ private readonly listeners;
1424
2086
  constructor(renderer: Renderer);
1425
2087
  protected init(): void;
2088
+ dispose(): void;
1426
2089
  findMeshChildren(from: Object3D, out?: Mesh[]): Mesh<three.BufferGeometry<three.NormalBufferAttributes>, three.Material | three.Material[], three.Object3DEventMap>[];
1427
- onClick(event: any): void;
2090
+ onClick(event: MouseEvent): void;
1428
2091
  appendTo(el: HTMLElement): void;
1429
2092
  protected handleRaycasterObjects(intersections: Intersection[]): void;
1430
- selectObject(targetObject: Object3D, targetIntersection?: Intersection): void;
1431
- protected redraw(targetObject: Object3D, targetIntersection?: Intersection): void;
1432
- protected addControls(object: Object3D, intersection?: Intersection): void;
2093
+ private getIntersectionInstance;
2094
+ selectObject(targetObject: Object3D, targetIntersection?: Intersection, instance?: Maybe<InstanceReference<SceneObject>>): void;
2095
+ protected redraw(targetObject: Object3D, targetIntersection?: Intersection, instance?: InstanceReference<SceneObject>): void;
2096
+ protected addControls(object: Object3D, intersection?: Intersection, instance?: InstanceReference<SceneObject>): void;
1433
2097
  protected addInfoLine(name: string, id: string, value: any): HTMLElement;
1434
- protected addObjectControls(target: Object3D, intersection: Maybe<Intersection>, container: HTMLElement): void;
2098
+ protected addObjectControls(target: Object3D, intersection: Maybe<Intersection>, container: HTMLElement, instance?: InstanceReference<SceneObject>): void;
1435
2099
  protected buttonControl(name: string, id: string, click: () => void): HTMLElement;
1436
2100
  protected selectControl(name: string, id: string, options: string[], change: (v: string) => void): HTMLElement;
1437
2101
  protected toggleControl(name: string, id: string, val: boolean, change: (v: boolean) => void): HTMLElement;
@@ -1439,13 +2103,15 @@ declare class SceneInspector {
1439
2103
  protected separator(name?: string): HTMLElement;
1440
2104
  }
1441
2105
 
1442
- declare class SceneStatsDisplay {
2106
+ declare class SceneStatsDisplay implements Disposable {
1443
2107
  readonly renderer: Renderer;
1444
2108
  readonly statsContainer: HTMLDivElement;
1445
2109
  private readonly lines;
2110
+ private interval?;
1446
2111
  constructor(renderer: Renderer);
1447
2112
  protected init(): void;
1448
2113
  appendTo(el: HTMLElement): void;
2114
+ dispose(): void;
1449
2115
  add(line?: StatLine): void;
1450
2116
  }
1451
2117
  declare class StatLine {
@@ -1460,34 +2126,33 @@ declare class StatLine {
1460
2126
  update(): void;
1461
2127
  }
1462
2128
 
1463
- declare class Requests {
1464
- private static axiosInstance;
1465
- private static mcAssetInstance;
1466
- private static genericQueue;
1467
- private static mcAssetRequestQueue;
1468
- static genericRequest(request: AxiosRequestConfig): Promise<AxiosResponse>;
1469
- static mcAssetRequest(request: AxiosRequestConfig): Promise<AxiosResponse>;
1470
- private static shouldRetry;
1471
- static setMcAssetRoot(root: string): void;
1472
- static get queueSizes(): {
1473
- generic: number;
1474
- mcAsset: number;
1475
- };
1476
- /**
1477
- * Stops both queue timers. jobqu reschedules itself indefinitely, so a Node process will not
1478
- * exit until this is called - see {@link shutdown}.
1479
- */
1480
- static end(): void;
1481
- }
1482
-
1483
2129
  type SkinGeometries = Record<SkinPart, TripleArray>;
1484
2130
  declare const classicSkinGeometries: SkinGeometries;
1485
2131
  declare const slimSkinGeometries: SkinGeometries;
1486
2132
 
2133
+ declare class SkinImage {
2134
+ static getData(src: string): Promise<ImageData>;
2135
+ private static decodePng;
2136
+ }
2137
+
1487
2138
  type SkinTextureCoordinates = Record<SkinPart, ModelFaces>;
1488
2139
  declare const classicSkinTextureCoordinates: Readonly<SkinTextureCoordinates>;
1489
2140
  declare const slimSkinTextureCoordinates: Readonly<SkinTextureCoordinates>;
1490
2141
 
2142
+ interface SkinTexture {
2143
+ material: MeshBasicMaterial;
2144
+ slim: boolean;
2145
+ legacy: boolean;
2146
+ }
2147
+ declare class SkinTextures {
2148
+ static get(src: string, legacy?: boolean): Promise<SkinTexture>;
2149
+ static getCape(src: string, layout?: CapeLayout): Promise<MeshBasicMaterial>;
2150
+ private static createMaterial;
2151
+ private static isSlim;
2152
+ private static normalizeLegacy;
2153
+ private static makeBaseOpaque;
2154
+ }
2155
+
1491
2156
  declare class Skins {
1492
2157
  static fromUuidOrUsername(uuidOrUsername: string): Promise<Maybe<string>>;
1493
2158
  static fromUuid(uuid: string): Promise<Maybe<string>>;
@@ -1496,8 +2161,11 @@ declare class Skins {
1496
2161
  static capeFromUuidOrUsername(uuidOrUsername: string): Promise<Maybe<string>>;
1497
2162
  static capeFromUuid(uuid: string): Promise<Maybe<string>>;
1498
2163
  static capeFromUsername(username: string): Promise<Maybe<string>>;
1499
- static capeFromCapesDev(uuid: string, capeType?: string): Promise<Maybe<string>>;
2164
+ /** Returns a full static cape texture for a username or UUID. */
2165
+ static capeFromCapesDev(player: string, capeType?: string): Promise<Maybe<string>>;
1500
2166
  private static usernameToUuid;
2167
+ private static usernameToUuidMcProxy;
2168
+ /** @deprecated **/
1501
2169
  private static usernameToUuidSkinProxy;
1502
2170
  private static usernameToUuidMineTools;
1503
2171
  private static getProfileFromMinetools;
@@ -1507,11 +2175,23 @@ declare class Skins {
1507
2175
  private static getCrafatarCapeUrl;
1508
2176
  private static getMcHeadsSkinUrl;
1509
2177
  private static getMineSkinPlayerSkinUrl;
2178
+ /** @deprecated **/
1510
2179
  private static getSkinProxySkinUrl;
2180
+ /** @deprecated **/
1511
2181
  private static getSkinProxyCapeUrl;
2182
+ private static getMcProxySkinUrl;
2183
+ private static getMcProxyCapeUrl;
2184
+ }
2185
+
2186
+ declare class Colormaps {
2187
+ /** Samples the selected resource pack's grass colormap using Minecraft's climate coordinates. */
2188
+ static grassColor(origin?: AssetKey, temperature?: number, downfall?: number): Promise<number>;
1512
2189
  }
1513
2190
 
1514
2191
  declare class TextureLoader {
2192
+ private static readonly failedTextures;
2193
+ /** Reports whether image loading failed, so cached textures can be retried. */
2194
+ static hasFailed(texture: Texture): boolean;
1515
2195
  protected static createTexture(): Texture;
1516
2196
  static loadInBackground(src: string, format?: PixelFormat, rotation?: number): Texture;
1517
2197
  static load(src: string, format?: PixelFormat, rotation?: number): Texture;
@@ -1533,61 +2213,155 @@ declare function mergeVertices(geometry: BufferGeometry, tolerance?: number): Bu
1533
2213
  declare function toTrianglesDrawMode(geometry: BufferGeometry, drawMode: TrianglesDrawModes): BufferGeometry;
1534
2214
  declare function computeMorphedAttributes(object: Mesh | Line | Points): object;
1535
2215
 
1536
- interface BlockInfo {
1537
- block: Block;
1538
- object: BlockObject;
2216
+ declare class ChunkData {
2217
+ private readonly indices;
2218
+ private readonly palette;
2219
+ private readonly paletteIds;
2220
+ private readonly freeIds;
2221
+ private readonly nbt;
2222
+ get(index: number): Maybe<Block>;
2223
+ snapshot(index: number): Maybe<() => Block>;
2224
+ set(index: number, block?: Block): void;
2225
+ clear(): void;
2226
+ static isAir(block: Maybe<Block>): boolean;
2227
+ private static copyBlock;
2228
+ private static validateIndex;
2229
+ }
2230
+
2231
+ type RegionInput = Uint8Array | ArrayBuffer;
2232
+ interface AnvilRegion {
2233
+ chunks: AnvilChunk[];
2234
+ }
2235
+ interface AnvilChunk {
2236
+ x: number;
2237
+ z: number;
2238
+ dataVersion?: number;
2239
+ sections: {
2240
+ y: number;
2241
+ data: ChunkData;
2242
+ }[];
2243
+ entities?: MultiBlockEntity[];
2244
+ }
2245
+ declare class AnvilParser {
2246
+ static getChunkList(data: RegionInput): {
2247
+ x: number;
2248
+ z: number;
2249
+ }[];
2250
+ static parse(data: RegionInput): Promise<AnvilRegion>;
2251
+ static parseChunk(data: RegionInput, localX: number, localZ: number): Promise<AnvilChunk | undefined>;
2252
+ private static bytes;
2253
+ private static locations;
2254
+ private static readChunk;
2255
+ private static compounds;
2256
+ private static integer;
2257
+ private static block;
2258
+ private static unpack;
2259
+ }
2260
+
2261
+ interface BlockInfo<SectionMeshing extends boolean = false> {
2262
+ /** Detached block data; use world or chunk setters to update stored blocks. */
2263
+ readonly block: Block;
2264
+ /** Merged terrain has no individual render object in section-meshing mode. */
2265
+ object: SectionMeshing extends false ? BlockObject : BlockObject | undefined;
2266
+ }
2267
+
2268
+ interface SectionMeshTemplate {
2269
+ geometry: BufferGeometry;
2270
+ atlas: TextureAtlas;
2271
+ cullFaces: readonly number[];
2272
+ }
2273
+ interface SectionMeshEntry {
2274
+ index: number;
2275
+ template: SectionMeshTemplate;
2276
+ cullMask: number;
2277
+ }
2278
+ declare class SectionMesh extends Group {
2279
+ private readonly ownedMeshes;
2280
+ static build(entries: readonly SectionMeshEntry[], maxAtlasSize?: number): SectionMesh;
2281
+ dispose(): void;
2282
+ }
2283
+
2284
+ declare class SectionModels {
2285
+ readonly maxAtlasSize: number;
2286
+ private states;
2287
+ private models;
2288
+ private readonly templates;
2289
+ constructor(maxAtlasSize?: number);
2290
+ get(blockState: BlockState, properties?: BlockStateProperties): Promise<SectionMeshTemplate | undefined>;
2291
+ private prepare;
2292
+ clear(): void;
1539
2293
  }
1540
2294
 
1541
- declare class Chunk {
2295
+ declare class Chunk<SectionMeshing extends boolean = false> {
2296
+ private readonly onBlocksChanged?;
2297
+ private readonly sectionModels?;
1542
2298
  readonly scene: MineRenderScene;
1543
2299
  readonly x: number;
1544
2300
  readonly y: number;
1545
2301
  readonly z: number;
1546
- private readonly _blocks;
1547
- private readonly _anchor;
1548
- constructor(scene: MineRenderScene, x: number, y: number, z: number);
1549
- getBlockAt(x: number, y: number, z: number): Maybe<BlockInfo>;
1550
- getBlockAt(pos: Vector3): Maybe<BlockInfo>;
1551
- getBlockAt(pos: TripleArray): Maybe<BlockInfo>;
2302
+ private readonly data;
2303
+ private readonly renderedBlocks;
2304
+ private readonly sectionBlocks;
2305
+ private sectionMesh?;
2306
+ private meshDirty;
2307
+ constructor(scene: MineRenderScene, x: number, y: number, z: number, onBlocksChanged?: ((positions: Vector3[]) => Promise<void>) | undefined, sectionModels?: SectionModels | undefined);
2308
+ getBlockAt(x: number, y: number, z: number): Maybe<BlockInfo<SectionMeshing>>;
2309
+ getBlockAt(pos: Vector3): Maybe<BlockInfo<SectionMeshing>>;
2310
+ getBlockAt(pos: TripleArray): Maybe<BlockInfo<SectionMeshing>>;
1552
2311
  /**
1553
2312
  * Set block at a _world_ position
1554
2313
  */
1555
- setBlockAt(x: number, y: number, z: number, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
1556
- setBlockAt(pos: Vector3, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
1557
- setBlockAt(pos: TripleArray, block: Maybe<Block>): Promise<Maybe<BlockInfo>>;
2314
+ setBlockAt(x: number, y: number, z: number, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2315
+ setBlockAt(pos: Vector3, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2316
+ setBlockAt(pos: TripleArray, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
1558
2317
  /**
1559
- * Set block at a _chunk_ position (0-16)
2318
+ * Set a block at integer chunk-local coordinates from 0 to 15.
1560
2319
  */
1561
- setBlockInChunkAt(pos: Vector3, block?: Block, worldPos?: Vector3): Promise<Maybe<BlockInfo>>;
1562
- clear(): Promise<void>;
2320
+ setBlockInChunkAt(pos: Vector3, block?: Block, worldPos?: Vector3, onBlocksChanged?: ((positions: Vector3[]) => Promise<void>) | undefined): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2321
+ isOccludingAt(pos: Vector3): boolean;
2322
+ setCullMaskAt(pos: Vector3, mask: number): Promise<void>;
2323
+ rebuildSectionMesh(): void;
2324
+ clear(onBlocksChanged?: ((positions: Vector3[]) => Promise<void>) | undefined): Promise<void>;
1563
2325
  dispose(): Promise<void>;
2326
+ static isAir(block: Maybe<Block>): boolean;
1564
2327
  static chunkPosToBlockIndex(pos: Vector3): number;
1565
2328
  worldPosToChunkPos(pos: Vector3): Vector3;
1566
2329
  chunkPosToWorldPos(pos: Vector3): Vector3;
1567
2330
  }
1568
2331
 
1569
- declare class MineRenderWorld {
2332
+ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
1570
2333
  readonly scene: MineRenderScene;
1571
- private _size;
1572
- private _blockSize;
1573
2334
  private readonly _chunks;
1574
- constructor(scene: MineRenderScene);
1575
- getBlockAt(x: number, y: number, z: number): Maybe<BlockInfo>;
1576
- getBlockAt(pos: Vector3): Maybe<BlockInfo>;
1577
- getBlockAt(pos: TripleArray): Maybe<BlockInfo>;
1578
- setBlockAt(x: number, y: number, z: number, block: Block): Promise<Maybe<BlockInfo>>;
1579
- setBlockAt(pos: Vector3, block: Block): Promise<Maybe<BlockInfo>>;
1580
- setBlockAt(pos: TripleArray, block: Block): Promise<Maybe<BlockInfo>>;
2335
+ private readonly sectionModels?;
2336
+ private readonly pendingCulling;
2337
+ private culling?;
2338
+ constructor(scene: MineRenderScene, options?: MineRenderWorldOptions<SectionMeshing>);
2339
+ getBlockAt(x: number, y: number, z: number): Maybe<BlockInfo<SectionMeshing>>;
2340
+ getBlockAt(pos: Vector3): Maybe<BlockInfo<SectionMeshing>>;
2341
+ getBlockAt(pos: TripleArray): Maybe<BlockInfo<SectionMeshing>>;
2342
+ setBlockAt(x: number, y: number, z: number, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2343
+ setBlockAt(pos: Vector3, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2344
+ setBlockAt(pos: TripleArray, block: Maybe<Block>): Promise<Maybe<BlockInfo<SectionMeshing>>>;
2345
+ private placeBlock;
1581
2346
  placeMultiBlock(multiblock: MultiBlockStructure, useBatches?: boolean, executor?: BatchedExecutor): Promise<void>;
2347
+ private placeBlocks;
2348
+ /** Replaces one chunk column's blocks. Entity NBT remains available on the parsed chunk. */
2349
+ placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
1582
2350
  clear(): Promise<void>;
2351
+ private updateCulling;
1583
2352
  private getOrCreateChunkAt;
1584
- getChunkAt(pos: Vector3): Maybe<Chunk>;
2353
+ getChunkAt(pos: Vector3): Maybe<Chunk<SectionMeshing>>;
1585
2354
  static worldToScenePosition(pos: Vector3): Vector3;
1586
2355
  static sceneToWorldPosition(pos: Vector3): Vector3;
1587
- worldPosToChunkIndex(pos: Vector3): number;
1588
2356
  worldPosToChunkKey(pos: Vector3): string;
1589
2357
  validatePosBounds(pos: Vector3): void;
1590
2358
  }
2359
+ interface MineRenderWorldOptions<SectionMeshing extends boolean = boolean> {
2360
+ /** Merge static opaque cubes into section meshes. Merged blocks have no individual object. */
2361
+ sectionMeshing?: SectionMeshing;
2362
+ /** Maximum width and height of each section atlas page, in pixels. */
2363
+ maxAtlasSize?: number;
2364
+ }
1591
2365
 
1592
2366
  /**
1593
2367
  * {@link EnvProvider} for headless Node.
@@ -1627,4 +2401,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
1627
2401
  forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
1628
2402
  }
1629
2403
 
1630
- export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, BlockEntityModels, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, Chunk, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, type Cube, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityModel, EntityModels, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, type ModelPart, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinObject, type SkinObjectOptions, SkinPart, type SkinTextureCoordinates, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, applyModelPartRotation, axisToVec3, base64decode, base64encode, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
2404
+ export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, type FrameCallback, type FromTo, Geometries, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiTextureLayer, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, SceneExporter, type SceneGLTFExportOptions, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, 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, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };