minerender 2.1.0-alpha.25 → 2.1.0-alpha.27

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/bundle.js CHANGED
@@ -78302,6 +78302,8 @@ return ${compiler2.callType("value", tagType)}
78302
78302
  if (textureKey) {
78303
78303
  const path2 = isAssetKey(textureKey) ? textureKey.getFullPath() : textureKey.path;
78304
78304
  texture = isAssetKey(textureKey) && textureKey.assetType === "textures" && path2.startsWith("entity/") ? textureKey : new AssetKey(textureKey.namespace, path2, "textures", "entity", "assets", ".png", isAssetKey(textureKey) ? textureKey.root : void 0);
78305
+ } else if (layer.textureLocation !== void 0) {
78306
+ texture = AssetKey.parse("textures", layer.textureLocation.replace(/^([^:]+:)?textures\//, "$1"));
78305
78307
  } else {
78306
78308
  texture = await this.resolveTexture(modelKey);
78307
78309
  }
@@ -81252,7 +81254,41 @@ return ${compiler2.callType("value", tagType)}
81252
81254
  var classicSkinTextureCoordinates = {
81253
81255
  ...baseSkinCoordinates
81254
81256
  };
81255
- var slimSkinTextureCoordinates = { ...baseSkinCoordinates };
81257
+ var slimSkinTextureCoordinates = {
81258
+ ...baseSkinCoordinates,
81259
+ leftArm: {
81260
+ ...baseSkinCoordinates.leftArm,
81261
+ west: { uv: [39, 52, 43, 64] },
81262
+ north: { uv: [36, 52, 39, 64] },
81263
+ south: { uv: [43, 52, 46, 64] },
81264
+ up: { uv: [39, 52, 36, 48] },
81265
+ down: { uv: [42, 48, 39, 52] }
81266
+ },
81267
+ rightArm: {
81268
+ ...baseSkinCoordinates.rightArm,
81269
+ west: { uv: [47, 20, 51, 32] },
81270
+ north: { uv: [44, 20, 47, 32] },
81271
+ south: { uv: [51, 20, 54, 32] },
81272
+ up: { uv: [47, 20, 44, 16] },
81273
+ down: { uv: [50, 16, 47, 20] }
81274
+ },
81275
+ leftSleeve: {
81276
+ ...baseSkinCoordinates.leftSleeve,
81277
+ west: { uv: [55, 52, 59, 64] },
81278
+ north: { uv: [52, 52, 55, 64] },
81279
+ south: { uv: [59, 52, 62, 64] },
81280
+ up: { uv: [55, 52, 52, 48] },
81281
+ down: { uv: [58, 48, 55, 52], rotation: 180 }
81282
+ },
81283
+ rightSleeve: {
81284
+ ...baseSkinCoordinates.rightSleeve,
81285
+ west: { uv: [47, 36, 51, 48] },
81286
+ north: { uv: [44, 36, 47, 48] },
81287
+ south: { uv: [51, 36, 54, 48] },
81288
+ up: { uv: [47, 36, 44, 32] },
81289
+ down: { uv: [50, 32, 47, 36], rotation: 180 }
81290
+ }
81291
+ };
81256
81292
 
81257
81293
  // src/skin/SkinGeometries.ts
81258
81294
  init_dirname();
@@ -81365,7 +81401,6 @@ return ${compiler2.callType("value", tagType)}
81365
81401
  }
81366
81402
  setSkinTexture(src) {
81367
81403
  if (typeof src === "undefined") return;
81368
- this.skinTextureSrc = src;
81369
81404
  const mat = Materials.getImage({
81370
81405
  texture: { src },
81371
81406
  transparent: true
@@ -81379,18 +81414,18 @@ return ${compiler2.callType("value", tagType)}
81379
81414
  }
81380
81415
  //TODO: cape
81381
81416
  setSlim(slim) {
81382
- console.log("#setSlim");
81383
- const changed = slim !== this.slim;
81417
+ if (slim === this.slim) return;
81384
81418
  this.slim = slim;
81385
- if (changed) {
81386
- this.createMeshes();
81387
- }
81388
- if (changed) {
81389
- if (this.skinTextureSrc) {
81390
- this.setSkinTexture(this.skinTextureSrc);
81391
- }
81392
- }
81393
- console.log("#setSlim done");
81419
+ for (const part of ["leftArm" /* LEFT_ARM */, "leftSleeve" /* LEFT_SLEEVE */, "rightArm" /* RIGHT_ARM */, "rightSleeve" /* RIGHT_SLEEVE */]) {
81420
+ const mesh = this.getMeshByName(part);
81421
+ if (mesh) mesh.geometry = this.getBoxGeometry(part);
81422
+ }
81423
+ const offset = slim ? 0.5 : -0.5;
81424
+ const leftArm = this.getGroupByName("leftArm" /* LEFT_ARM */);
81425
+ const rightArm = this.getGroupByName("rightArm" /* RIGHT_ARM */);
81426
+ if (leftArm) leftArm.position.x += offset;
81427
+ if (rightArm) rightArm.position.x -= offset;
81428
+ this.notifyDirty();
81394
81429
  }
81395
81430
  setLegacy(legacy) {
81396
81431
  if (legacy !== this.legacy) {