minerender 2.1.0-alpha.29 → 2.1.0-alpha.30

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.
@@ -913,6 +913,9 @@ declare enum SkinPart {
913
913
  }
914
914
  declare const SKIN_PARTS: SkinPart[];
915
915
 
916
+ type CapeLayout = "minecraft" | "optifine" | "labymod";
917
+ declare const capeTextureSizes: Record<CapeLayout, DoubleArray>;
918
+
916
919
  declare class SkinObject extends SceneObject {
917
920
  readonly options: SkinObjectOptions;
918
921
  private slim;
@@ -926,8 +929,8 @@ declare class SkinObject extends SceneObject {
926
929
  protected removeMeshes(): void;
927
930
  protected createMeshes(): void;
928
931
  setSkinTexture(src: string): Promise<void>;
929
- /** Load a vanilla cape texture, or pass undefined to remove the cape. */
930
- setCapeTexture(src?: string): Promise<void>;
932
+ /** Load a cape texture in the selected layout, or pass undefined to remove the cape. */
933
+ setCapeTexture(src?: string, layout?: CapeLayout): Promise<void>;
931
934
  /** Select the arm model, or pass undefined to use texture detection. */
932
935
  setSlim(slim?: boolean): void;
933
936
  private updateSlim;
@@ -1586,7 +1589,7 @@ interface SkinTexture {
1586
1589
  }
1587
1590
  declare class SkinTextures {
1588
1591
  static get(src: string, legacy?: boolean): Promise<SkinTexture>;
1589
- static getCape(src: string): Promise<MeshBasicMaterial>;
1592
+ static getCape(src: string, layout?: CapeLayout): Promise<MeshBasicMaterial>;
1590
1593
  private static createMaterial;
1591
1594
  private static isSlim;
1592
1595
  private static normalizeLegacy;
@@ -1600,7 +1603,8 @@ declare class Skins {
1600
1603
  static capeFromUuidOrUsername(uuidOrUsername: string): Promise<Maybe<string>>;
1601
1604
  static capeFromUuid(uuid: string): Promise<Maybe<string>>;
1602
1605
  static capeFromUsername(username: string): Promise<Maybe<string>>;
1603
- static capeFromCapesDev(uuid: string, capeType?: string): Promise<Maybe<string>>;
1606
+ /** Returns a full static cape texture for a username or UUID. */
1607
+ static capeFromCapesDev(player: string, capeType?: string): Promise<Maybe<string>>;
1604
1608
  private static usernameToUuid;
1605
1609
  private static usernameToUuidMcProxy;
1606
1610
  /** @deprecated **/
@@ -1740,4 +1744,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
1740
1744
  forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
1741
1745
  }
1742
1746
 
1743
- 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, 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, NodeCache, NodeEnv, 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, registerNodeEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
1747
+ 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, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, 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, NodeCache, NodeEnv, 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, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
@@ -913,6 +913,9 @@ declare enum SkinPart {
913
913
  }
914
914
  declare const SKIN_PARTS: SkinPart[];
915
915
 
916
+ type CapeLayout = "minecraft" | "optifine" | "labymod";
917
+ declare const capeTextureSizes: Record<CapeLayout, DoubleArray>;
918
+
916
919
  declare class SkinObject extends SceneObject {
917
920
  readonly options: SkinObjectOptions;
918
921
  private slim;
@@ -926,8 +929,8 @@ declare class SkinObject extends SceneObject {
926
929
  protected removeMeshes(): void;
927
930
  protected createMeshes(): void;
928
931
  setSkinTexture(src: string): Promise<void>;
929
- /** Load a vanilla cape texture, or pass undefined to remove the cape. */
930
- setCapeTexture(src?: string): Promise<void>;
932
+ /** Load a cape texture in the selected layout, or pass undefined to remove the cape. */
933
+ setCapeTexture(src?: string, layout?: CapeLayout): Promise<void>;
931
934
  /** Select the arm model, or pass undefined to use texture detection. */
932
935
  setSlim(slim?: boolean): void;
933
936
  private updateSlim;
@@ -1586,7 +1589,7 @@ interface SkinTexture {
1586
1589
  }
1587
1590
  declare class SkinTextures {
1588
1591
  static get(src: string, legacy?: boolean): Promise<SkinTexture>;
1589
- static getCape(src: string): Promise<MeshBasicMaterial>;
1592
+ static getCape(src: string, layout?: CapeLayout): Promise<MeshBasicMaterial>;
1590
1593
  private static createMaterial;
1591
1594
  private static isSlim;
1592
1595
  private static normalizeLegacy;
@@ -1600,7 +1603,8 @@ declare class Skins {
1600
1603
  static capeFromUuidOrUsername(uuidOrUsername: string): Promise<Maybe<string>>;
1601
1604
  static capeFromUuid(uuid: string): Promise<Maybe<string>>;
1602
1605
  static capeFromUsername(username: string): Promise<Maybe<string>>;
1603
- static capeFromCapesDev(uuid: string, capeType?: string): Promise<Maybe<string>>;
1606
+ /** Returns a full static cape texture for a username or UUID. */
1607
+ static capeFromCapesDev(player: string, capeType?: string): Promise<Maybe<string>>;
1604
1608
  private static usernameToUuid;
1605
1609
  private static usernameToUuidMcProxy;
1606
1610
  /** @deprecated **/
@@ -1740,4 +1744,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
1740
1744
  forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
1741
1745
  }
1742
1746
 
1743
- 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, 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, NodeCache, NodeEnv, 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, registerNodeEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
1747
+ 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, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, 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, NodeCache, NodeEnv, 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, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
@@ -213,6 +213,7 @@ __export(index_node_exports, {
213
213
  axisToVec3: () => axisToVec3,
214
214
  base64decode: () => base64decode,
215
215
  base64encode: () => base64encode,
216
+ capeTextureSizes: () => capeTextureSizes,
216
217
  captureException: () => captureException,
217
218
  changeEvent: () => changeEvent,
218
219
  clampRotationDegrees: () => clampRotationDegrees,
@@ -5749,10 +5750,10 @@ var SkinTextures = class {
5749
5750
  });
5750
5751
  return { material, slim, legacy: isLegacy };
5751
5752
  }
5752
- static async getCape(src) {
5753
+ static async getCape(src, layout = "minecraft") {
5753
5754
  const image = await ImageLoader.getData(src);
5754
5755
  const scale = image.width / 64;
5755
- if (!Number.isInteger(scale) || scale < 1 || image.height !== image.width / 2) {
5756
+ if (layout === "minecraft" && (!Number.isInteger(scale) || scale < 1 || image.height !== image.width / 2)) {
5756
5757
  throw new MineRenderError(`Invalid cape dimensions ${image.width}x${image.height}; expected 64x32 or an integer-scaled equivalent`);
5757
5758
  }
5758
5759
  return Caching.materialCache.get(`cape:${serializeImageKey({ src })}`, () => {
@@ -5821,6 +5822,13 @@ var SkinTextures = class {
5821
5822
  }
5822
5823
  };
5823
5824
 
5825
+ // src/skin/CapeLayout.ts
5826
+ var capeTextureSizes = {
5827
+ minecraft: [64, 32],
5828
+ optifine: [46, 22],
5829
+ labymod: [22, 17]
5830
+ };
5831
+
5824
5832
  // src/skin/scene/SkinObject.ts
5825
5833
  var SkinObject = class extends SceneObject {
5826
5834
  constructor(options) {
@@ -5906,8 +5914,8 @@ var SkinObject = class extends SceneObject {
5906
5914
  }
5907
5915
  this.notifyDirty();
5908
5916
  }
5909
- /** Load a vanilla cape texture, or pass undefined to remove the cape. */
5910
- async setCapeTexture(src) {
5917
+ /** Load a cape texture in the selected layout, or pass undefined to remove the cape. */
5918
+ async setCapeTexture(src, layout = "minecraft") {
5911
5919
  const load = ++this.capeLoad;
5912
5920
  if (src === void 0) {
5913
5921
  const group = this.getGroupByName("cape" /* CAPE */);
@@ -5915,20 +5923,22 @@ var SkinObject = class extends SceneObject {
5915
5923
  this.notifyDirty();
5916
5924
  return;
5917
5925
  }
5918
- const material = await SkinTextures.getCape(src);
5926
+ const material = await SkinTextures.getCape(src, layout);
5919
5927
  if (load !== this.capeLoad) return;
5928
+ const size = capeTextureSizes[layout];
5929
+ const geometry = this._getBoxGeometryFromDimensions(
5930
+ classicSkinGeometries.cape,
5931
+ classicSkinTextureCoordinates.cape,
5932
+ size,
5933
+ size
5934
+ );
5920
5935
  const mesh = this.getMeshByName("cape" /* CAPE */);
5921
5936
  if (mesh) {
5922
5937
  mesh.material = material;
5938
+ mesh.geometry = geometry;
5923
5939
  } else {
5924
5940
  const group = this.createAndAddGroup("cape" /* CAPE */, 0, 24, 2);
5925
5941
  group.rotation.set(toRadians(-6), Math.PI, 0);
5926
- const geometry = this._getBoxGeometryFromDimensions(
5927
- classicSkinGeometries.cape,
5928
- classicSkinTextureCoordinates.cape,
5929
- [64, 32],
5930
- [64, 32]
5931
- );
5932
5942
  const cape = this.createAndAddMesh("cape" /* CAPE */, group, geometry, material);
5933
5943
  cape.position.set(0, -8, -0.5);
5934
5944
  }
@@ -7128,13 +7138,10 @@ var Skins = class {
7128
7138
  return void 0;
7129
7139
  });
7130
7140
  }
7131
- static async capeFromCapesDev(uuid, capeType = "minecraft") {
7132
- return this.getCapesDev(uuid, capeType).then((cape) => {
7133
- if (cape) {
7134
- return cape?.stillImageUrl;
7135
- }
7136
- return void 0;
7137
- });
7141
+ /** Returns a full static cape texture for a username or UUID. */
7142
+ static async capeFromCapesDev(player, capeType = "minecraft") {
7143
+ const cape = await this.getCapesDev(player, capeType);
7144
+ return cape?.exists ? cape.imageUrls?.still?.full : void 0;
7138
7145
  }
7139
7146
  //</editor-fold>
7140
7147
  //<editor-fold desc="Helpers">
@@ -7208,18 +7215,15 @@ var Skins = class {
7208
7215
  return void 0;
7209
7216
  });
7210
7217
  }
7211
- static async getCapesDev(uuid, type = "all") {
7218
+ static async getCapesDev(player, type = "all") {
7212
7219
  return Requests.genericRequest({
7213
7220
  baseURL: "https://api.capes.dev",
7214
- url: "/load/" + uuid + "/" + type
7221
+ url: "/load/" + encodeURIComponent(player) + "/" + encodeURIComponent(type)
7215
7222
  }).then((res) => {
7216
7223
  if (res.status === 200) {
7217
7224
  return res.data;
7218
7225
  }
7219
7226
  return void 0;
7220
- }).catch((err) => {
7221
- console.warn(err);
7222
- return void 0;
7223
7227
  });
7224
7228
  }
7225
7229
  static getCrafatarSkinUrl(uuid) {
@@ -7570,6 +7574,7 @@ var Chunk = class _Chunk {
7570
7574
  axisToVec3,
7571
7575
  base64decode,
7572
7576
  base64encode,
7577
+ capeTextureSizes,
7573
7578
  captureException,
7574
7579
  changeEvent,
7575
7580
  clampRotationDegrees,