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