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