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.
@@ -2694,6 +2694,8 @@ var Entities = class {
2694
2694
  if (textureKey) {
2695
2695
  const path2 = isAssetKey(textureKey) ? textureKey.getFullPath() : textureKey.path;
2696
2696
  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);
2697
+ } else if (layer.textureLocation !== void 0) {
2698
+ texture = AssetKey.parse("textures", layer.textureLocation.replace(/^([^:]+:)?textures\//, "$1"));
2697
2699
  } else {
2698
2700
  texture = await this.resolveTexture(modelKey);
2699
2701
  }
@@ -5458,7 +5460,41 @@ var baseSkinCoordinates = {
5458
5460
  var classicSkinTextureCoordinates = {
5459
5461
  ...baseSkinCoordinates
5460
5462
  };
5461
- var slimSkinTextureCoordinates = { ...baseSkinCoordinates };
5463
+ var slimSkinTextureCoordinates = {
5464
+ ...baseSkinCoordinates,
5465
+ leftArm: {
5466
+ ...baseSkinCoordinates.leftArm,
5467
+ west: { uv: [39, 52, 43, 64] },
5468
+ north: { uv: [36, 52, 39, 64] },
5469
+ south: { uv: [43, 52, 46, 64] },
5470
+ up: { uv: [39, 52, 36, 48] },
5471
+ down: { uv: [42, 48, 39, 52] }
5472
+ },
5473
+ rightArm: {
5474
+ ...baseSkinCoordinates.rightArm,
5475
+ west: { uv: [47, 20, 51, 32] },
5476
+ north: { uv: [44, 20, 47, 32] },
5477
+ south: { uv: [51, 20, 54, 32] },
5478
+ up: { uv: [47, 20, 44, 16] },
5479
+ down: { uv: [50, 16, 47, 20] }
5480
+ },
5481
+ leftSleeve: {
5482
+ ...baseSkinCoordinates.leftSleeve,
5483
+ west: { uv: [55, 52, 59, 64] },
5484
+ north: { uv: [52, 52, 55, 64] },
5485
+ south: { uv: [59, 52, 62, 64] },
5486
+ up: { uv: [55, 52, 52, 48] },
5487
+ down: { uv: [58, 48, 55, 52], rotation: 180 }
5488
+ },
5489
+ rightSleeve: {
5490
+ ...baseSkinCoordinates.rightSleeve,
5491
+ west: { uv: [47, 36, 51, 48] },
5492
+ north: { uv: [44, 36, 47, 48] },
5493
+ south: { uv: [51, 36, 54, 48] },
5494
+ up: { uv: [47, 36, 44, 32] },
5495
+ down: { uv: [50, 32, 47, 36], rotation: 180 }
5496
+ }
5497
+ };
5462
5498
 
5463
5499
  // src/skin/SkinGeometries.ts
5464
5500
  var box8inner = [8, 8, 8];
@@ -5568,7 +5604,6 @@ var SkinObject = class extends SceneObject {
5568
5604
  }
5569
5605
  setSkinTexture(src) {
5570
5606
  if (typeof src === "undefined") return;
5571
- this.skinTextureSrc = src;
5572
5607
  const mat = Materials.getImage({
5573
5608
  texture: { src },
5574
5609
  transparent: true
@@ -5582,18 +5617,18 @@ var SkinObject = class extends SceneObject {
5582
5617
  }
5583
5618
  //TODO: cape
5584
5619
  setSlim(slim) {
5585
- console.log("#setSlim");
5586
- const changed = slim !== this.slim;
5620
+ if (slim === this.slim) return;
5587
5621
  this.slim = slim;
5588
- if (changed) {
5589
- this.createMeshes();
5590
- }
5591
- if (changed) {
5592
- if (this.skinTextureSrc) {
5593
- this.setSkinTexture(this.skinTextureSrc);
5594
- }
5595
- }
5596
- console.log("#setSlim done");
5622
+ for (const part of ["leftArm" /* LEFT_ARM */, "leftSleeve" /* LEFT_SLEEVE */, "rightArm" /* RIGHT_ARM */, "rightSleeve" /* RIGHT_SLEEVE */]) {
5623
+ const mesh = this.getMeshByName(part);
5624
+ if (mesh) mesh.geometry = this.getBoxGeometry(part);
5625
+ }
5626
+ const offset = slim ? 0.5 : -0.5;
5627
+ const leftArm = this.getGroupByName("leftArm" /* LEFT_ARM */);
5628
+ const rightArm = this.getGroupByName("rightArm" /* RIGHT_ARM */);
5629
+ if (leftArm) leftArm.position.x += offset;
5630
+ if (rightArm) rightArm.position.x -= offset;
5631
+ this.notifyDirty();
5597
5632
  }
5598
5633
  setLegacy(legacy) {
5599
5634
  if (legacy !== this.legacy) {