minerender 2.1.0-alpha.27 → 2.1.0-alpha.29
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/dist/browser/index.d.mts +53 -10
- package/dist/browser/index.d.ts +53 -10
- package/dist/browser/index.js +285 -148
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +220 -83
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +230 -81
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +53 -10
- package/dist/node/index.d.ts +53 -10
- package/dist/node/index.js +288 -148
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +222 -83
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Scene, Object3DEventMap, Texture, Camera, MOUSE, TOUCH, WebGLRenderer, EventDispatcher, Raycaster, Intersection, MeshBasicMaterial, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points } from 'three';
|
|
3
3
|
import * as nodeCanvas from 'canvas';
|
|
4
4
|
import { ImageData as ImageData$1, CanvasRenderingContext2D } from 'canvas';
|
|
5
5
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
@@ -623,6 +623,12 @@ declare enum AssetParser {
|
|
|
623
623
|
declare abstract class AssetSource {
|
|
624
624
|
protected constructor();
|
|
625
625
|
abstract get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
|
|
626
|
+
/**
|
|
627
|
+
* Identifies this source's content across sessions for persistent caching. Sources that
|
|
628
|
+
* cannot tell whether their content changed (an unnamed archive, for example) return
|
|
629
|
+
* undefined, which keeps their results out of long-lived caches.
|
|
630
|
+
*/
|
|
631
|
+
get cacheId(): Maybe<string>;
|
|
626
632
|
}
|
|
627
633
|
/** A source failed to load or parse an asset; cause retains the original failure. */
|
|
628
634
|
declare class AssetLoadError extends Error {
|
|
@@ -636,8 +642,18 @@ declare class AssetLoadError extends Error {
|
|
|
636
642
|
declare class AssetLoader {
|
|
637
643
|
static ROOT: string;
|
|
638
644
|
private static _SOURCES;
|
|
645
|
+
/** Used when a registered source cannot identify its content, so nothing persists past this session. */
|
|
646
|
+
private static readonly SESSION_SCOPE;
|
|
639
647
|
static get version(): string;
|
|
640
648
|
static setVersion(version: string): void;
|
|
649
|
+
/**
|
|
650
|
+
* Scope for persistent cache keys. Empty with only the default vanilla sources, so their
|
|
651
|
+
* entries stay valid across sessions; otherwise it names every added source (resource packs,
|
|
652
|
+
* mirrors) so their results never masquerade as vanilla assets after a reload.
|
|
653
|
+
*/
|
|
654
|
+
static get persistentScope(): string;
|
|
655
|
+
/** Prefixes a persistent cache key with the current source scope. */
|
|
656
|
+
static persistentKey(key: string): string;
|
|
641
657
|
static addSource(key: string, source: AssetSource, override?: boolean): void;
|
|
642
658
|
static removeSource(key: string): Maybe<AssetSource>;
|
|
643
659
|
static getAll<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<T[]>;
|
|
@@ -899,20 +915,29 @@ declare const SKIN_PARTS: SkinPart[];
|
|
|
899
915
|
declare class SkinObject extends SceneObject {
|
|
900
916
|
readonly options: SkinObjectOptions;
|
|
901
917
|
private slim;
|
|
902
|
-
private
|
|
903
|
-
private
|
|
904
|
-
private
|
|
905
|
-
private
|
|
918
|
+
private detectedSlim;
|
|
919
|
+
private skinTextureSrc?;
|
|
920
|
+
private skinMaterial?;
|
|
921
|
+
private skinLoad;
|
|
922
|
+
private capeLoad;
|
|
906
923
|
constructor(options?: DeepPartial<SkinObjectOptions>);
|
|
907
924
|
init(): Promise<void>;
|
|
908
925
|
protected removeMeshes(): void;
|
|
909
926
|
protected createMeshes(): void;
|
|
910
|
-
setSkinTexture(src: string): void
|
|
911
|
-
|
|
912
|
-
|
|
927
|
+
setSkinTexture(src: string): Promise<void>;
|
|
928
|
+
/** Load a vanilla cape texture, or pass undefined to remove the cape. */
|
|
929
|
+
setCapeTexture(src?: string): Promise<void>;
|
|
930
|
+
/** Select the arm model, or pass undefined to use texture detection. */
|
|
931
|
+
setSlim(slim?: boolean): void;
|
|
932
|
+
private updateSlim;
|
|
933
|
+
/** Select the texture layout, or pass undefined to detect it from image dimensions. */
|
|
934
|
+
setLegacy(legacy?: boolean): Promise<void>;
|
|
935
|
+
dispose(): void;
|
|
913
936
|
protected getBoxGeometry(part: SkinPart): BoxGeometry;
|
|
914
937
|
}
|
|
915
938
|
interface SkinObjectOptions extends SceneObjectOptions {
|
|
939
|
+
slim?: boolean;
|
|
940
|
+
legacy?: boolean;
|
|
916
941
|
}
|
|
917
942
|
|
|
918
943
|
declare class EntityObject extends SceneObject {
|
|
@@ -1179,6 +1204,7 @@ declare class HostedAssetSource extends AssetSource {
|
|
|
1179
1204
|
private readonly _options;
|
|
1180
1205
|
constructor(root: string, options?: Partial<HostedAssetSourceOptions>);
|
|
1181
1206
|
get root(): string;
|
|
1207
|
+
get cacheId(): string;
|
|
1182
1208
|
get options(): HostedAssetSourceOptions;
|
|
1183
1209
|
get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser): Promise<Maybe<T>>;
|
|
1184
1210
|
}
|
|
@@ -1193,6 +1219,8 @@ interface ArchiveEntry {
|
|
|
1193
1219
|
}
|
|
1194
1220
|
|
|
1195
1221
|
interface ArchiveProxy {
|
|
1222
|
+
/** Identifies the archive's content across sessions; undefined when it cannot be identified. */
|
|
1223
|
+
readonly id?: string;
|
|
1196
1224
|
getEntries(): Promise<ArchiveEntry[]>;
|
|
1197
1225
|
}
|
|
1198
1226
|
|
|
@@ -1200,6 +1228,7 @@ declare class ArchiveAssetSource extends AssetSource implements ArchiveProxy {
|
|
|
1200
1228
|
readonly _archiveProxy: ArchiveProxy;
|
|
1201
1229
|
constructor(archiveProxy: ArchiveProxy);
|
|
1202
1230
|
static blob(blob: Blob): ArchiveAssetSource;
|
|
1231
|
+
get cacheId(): Maybe<string>;
|
|
1203
1232
|
getEntries(): Promise<ArchiveEntry[]>;
|
|
1204
1233
|
getEntry(path: string): Promise<Maybe<ArchiveEntry>>;
|
|
1205
1234
|
get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
|
|
@@ -1210,7 +1239,8 @@ declare class ArchiveAssetSource extends AssetSource implements ArchiveProxy {
|
|
|
1210
1239
|
declare class BrowserArchiveProxy implements ArchiveProxy {
|
|
1211
1240
|
readonly _blob: Blob;
|
|
1212
1241
|
readonly _reader: ZipReader<Blob>;
|
|
1213
|
-
|
|
1242
|
+
readonly id?: string;
|
|
1243
|
+
constructor(blob: Blob, id?: string);
|
|
1214
1244
|
getEntries(): Promise<ArchiveEntry[]>;
|
|
1215
1245
|
}
|
|
1216
1246
|
|
|
@@ -1548,6 +1578,19 @@ type SkinTextureCoordinates = Record<SkinPart, ModelFaces>;
|
|
|
1548
1578
|
declare const classicSkinTextureCoordinates: Readonly<SkinTextureCoordinates>;
|
|
1549
1579
|
declare const slimSkinTextureCoordinates: Readonly<SkinTextureCoordinates>;
|
|
1550
1580
|
|
|
1581
|
+
interface SkinTexture {
|
|
1582
|
+
material: MeshBasicMaterial;
|
|
1583
|
+
slim: boolean;
|
|
1584
|
+
legacy: boolean;
|
|
1585
|
+
}
|
|
1586
|
+
declare class SkinTextures {
|
|
1587
|
+
static get(src: string, legacy?: boolean): Promise<SkinTexture>;
|
|
1588
|
+
static getCape(src: string): Promise<MeshBasicMaterial>;
|
|
1589
|
+
private static createMaterial;
|
|
1590
|
+
private static isSlim;
|
|
1591
|
+
private static normalizeLegacy;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1551
1594
|
declare class Skins {
|
|
1552
1595
|
static fromUuidOrUsername(uuidOrUsername: string): Promise<Maybe<string>>;
|
|
1553
1596
|
static fromUuid(uuid: string): Promise<Maybe<string>>;
|
|
@@ -1694,4 +1737,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
|
|
|
1694
1737
|
*/
|
|
1695
1738
|
declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
|
|
1696
1739
|
|
|
1697
|
-
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, Chunk, 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, type ElementFace, type ElementRotation, Entities, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinObject, type SkinObjectOptions, SkinPart, type SkinTextureCoordinates, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|
|
1740
|
+
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, Chunk, 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, type ElementFace, type ElementRotation, Entities, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Scene, Object3DEventMap, Texture, Camera, MOUSE, TOUCH, WebGLRenderer, EventDispatcher, Raycaster, Intersection, MeshBasicMaterial, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points } from 'three';
|
|
3
3
|
import * as nodeCanvas from 'canvas';
|
|
4
4
|
import { ImageData as ImageData$1, CanvasRenderingContext2D } from 'canvas';
|
|
5
5
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
@@ -623,6 +623,12 @@ declare enum AssetParser {
|
|
|
623
623
|
declare abstract class AssetSource {
|
|
624
624
|
protected constructor();
|
|
625
625
|
abstract get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
|
|
626
|
+
/**
|
|
627
|
+
* Identifies this source's content across sessions for persistent caching. Sources that
|
|
628
|
+
* cannot tell whether their content changed (an unnamed archive, for example) return
|
|
629
|
+
* undefined, which keeps their results out of long-lived caches.
|
|
630
|
+
*/
|
|
631
|
+
get cacheId(): Maybe<string>;
|
|
626
632
|
}
|
|
627
633
|
/** A source failed to load or parse an asset; cause retains the original failure. */
|
|
628
634
|
declare class AssetLoadError extends Error {
|
|
@@ -636,8 +642,18 @@ declare class AssetLoadError extends Error {
|
|
|
636
642
|
declare class AssetLoader {
|
|
637
643
|
static ROOT: string;
|
|
638
644
|
private static _SOURCES;
|
|
645
|
+
/** Used when a registered source cannot identify its content, so nothing persists past this session. */
|
|
646
|
+
private static readonly SESSION_SCOPE;
|
|
639
647
|
static get version(): string;
|
|
640
648
|
static setVersion(version: string): void;
|
|
649
|
+
/**
|
|
650
|
+
* Scope for persistent cache keys. Empty with only the default vanilla sources, so their
|
|
651
|
+
* entries stay valid across sessions; otherwise it names every added source (resource packs,
|
|
652
|
+
* mirrors) so their results never masquerade as vanilla assets after a reload.
|
|
653
|
+
*/
|
|
654
|
+
static get persistentScope(): string;
|
|
655
|
+
/** Prefixes a persistent cache key with the current source scope. */
|
|
656
|
+
static persistentKey(key: string): string;
|
|
641
657
|
static addSource(key: string, source: AssetSource, override?: boolean): void;
|
|
642
658
|
static removeSource(key: string): Maybe<AssetSource>;
|
|
643
659
|
static getAll<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<T[]>;
|
|
@@ -899,20 +915,29 @@ declare const SKIN_PARTS: SkinPart[];
|
|
|
899
915
|
declare class SkinObject extends SceneObject {
|
|
900
916
|
readonly options: SkinObjectOptions;
|
|
901
917
|
private slim;
|
|
902
|
-
private
|
|
903
|
-
private
|
|
904
|
-
private
|
|
905
|
-
private
|
|
918
|
+
private detectedSlim;
|
|
919
|
+
private skinTextureSrc?;
|
|
920
|
+
private skinMaterial?;
|
|
921
|
+
private skinLoad;
|
|
922
|
+
private capeLoad;
|
|
906
923
|
constructor(options?: DeepPartial<SkinObjectOptions>);
|
|
907
924
|
init(): Promise<void>;
|
|
908
925
|
protected removeMeshes(): void;
|
|
909
926
|
protected createMeshes(): void;
|
|
910
|
-
setSkinTexture(src: string): void
|
|
911
|
-
|
|
912
|
-
|
|
927
|
+
setSkinTexture(src: string): Promise<void>;
|
|
928
|
+
/** Load a vanilla cape texture, or pass undefined to remove the cape. */
|
|
929
|
+
setCapeTexture(src?: string): Promise<void>;
|
|
930
|
+
/** Select the arm model, or pass undefined to use texture detection. */
|
|
931
|
+
setSlim(slim?: boolean): void;
|
|
932
|
+
private updateSlim;
|
|
933
|
+
/** Select the texture layout, or pass undefined to detect it from image dimensions. */
|
|
934
|
+
setLegacy(legacy?: boolean): Promise<void>;
|
|
935
|
+
dispose(): void;
|
|
913
936
|
protected getBoxGeometry(part: SkinPart): BoxGeometry;
|
|
914
937
|
}
|
|
915
938
|
interface SkinObjectOptions extends SceneObjectOptions {
|
|
939
|
+
slim?: boolean;
|
|
940
|
+
legacy?: boolean;
|
|
916
941
|
}
|
|
917
942
|
|
|
918
943
|
declare class EntityObject extends SceneObject {
|
|
@@ -1179,6 +1204,7 @@ declare class HostedAssetSource extends AssetSource {
|
|
|
1179
1204
|
private readonly _options;
|
|
1180
1205
|
constructor(root: string, options?: Partial<HostedAssetSourceOptions>);
|
|
1181
1206
|
get root(): string;
|
|
1207
|
+
get cacheId(): string;
|
|
1182
1208
|
get options(): HostedAssetSourceOptions;
|
|
1183
1209
|
get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser): Promise<Maybe<T>>;
|
|
1184
1210
|
}
|
|
@@ -1193,6 +1219,8 @@ interface ArchiveEntry {
|
|
|
1193
1219
|
}
|
|
1194
1220
|
|
|
1195
1221
|
interface ArchiveProxy {
|
|
1222
|
+
/** Identifies the archive's content across sessions; undefined when it cannot be identified. */
|
|
1223
|
+
readonly id?: string;
|
|
1196
1224
|
getEntries(): Promise<ArchiveEntry[]>;
|
|
1197
1225
|
}
|
|
1198
1226
|
|
|
@@ -1200,6 +1228,7 @@ declare class ArchiveAssetSource extends AssetSource implements ArchiveProxy {
|
|
|
1200
1228
|
readonly _archiveProxy: ArchiveProxy;
|
|
1201
1229
|
constructor(archiveProxy: ArchiveProxy);
|
|
1202
1230
|
static blob(blob: Blob): ArchiveAssetSource;
|
|
1231
|
+
get cacheId(): Maybe<string>;
|
|
1203
1232
|
getEntries(): Promise<ArchiveEntry[]>;
|
|
1204
1233
|
getEntry(path: string): Promise<Maybe<ArchiveEntry>>;
|
|
1205
1234
|
get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
|
|
@@ -1210,7 +1239,8 @@ declare class ArchiveAssetSource extends AssetSource implements ArchiveProxy {
|
|
|
1210
1239
|
declare class BrowserArchiveProxy implements ArchiveProxy {
|
|
1211
1240
|
readonly _blob: Blob;
|
|
1212
1241
|
readonly _reader: ZipReader<Blob>;
|
|
1213
|
-
|
|
1242
|
+
readonly id?: string;
|
|
1243
|
+
constructor(blob: Blob, id?: string);
|
|
1214
1244
|
getEntries(): Promise<ArchiveEntry[]>;
|
|
1215
1245
|
}
|
|
1216
1246
|
|
|
@@ -1548,6 +1578,19 @@ type SkinTextureCoordinates = Record<SkinPart, ModelFaces>;
|
|
|
1548
1578
|
declare const classicSkinTextureCoordinates: Readonly<SkinTextureCoordinates>;
|
|
1549
1579
|
declare const slimSkinTextureCoordinates: Readonly<SkinTextureCoordinates>;
|
|
1550
1580
|
|
|
1581
|
+
interface SkinTexture {
|
|
1582
|
+
material: MeshBasicMaterial;
|
|
1583
|
+
slim: boolean;
|
|
1584
|
+
legacy: boolean;
|
|
1585
|
+
}
|
|
1586
|
+
declare class SkinTextures {
|
|
1587
|
+
static get(src: string, legacy?: boolean): Promise<SkinTexture>;
|
|
1588
|
+
static getCape(src: string): Promise<MeshBasicMaterial>;
|
|
1589
|
+
private static createMaterial;
|
|
1590
|
+
private static isSlim;
|
|
1591
|
+
private static normalizeLegacy;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1551
1594
|
declare class Skins {
|
|
1552
1595
|
static fromUuidOrUsername(uuidOrUsername: string): Promise<Maybe<string>>;
|
|
1553
1596
|
static fromUuid(uuid: string): Promise<Maybe<string>>;
|
|
@@ -1694,4 +1737,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
|
|
|
1694
1737
|
*/
|
|
1695
1738
|
declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
|
|
1696
1739
|
|
|
1697
|
-
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, Chunk, 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, type ElementFace, type ElementRotation, Entities, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinObject, type SkinObjectOptions, SkinPart, type SkinTextureCoordinates, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|
|
1740
|
+
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, Chunk, 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, type ElementFace, type ElementRotation, Entities, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|