minerender 2.1.0-alpha.26 → 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.
@@ -900,7 +900,6 @@ declare class SkinObject extends SceneObject {
900
900
  readonly options: SkinObjectOptions;
901
901
  private slim;
902
902
  private legacy;
903
- private skinTextureSrc?;
904
903
  private skinTextureWidth;
905
904
  private skinTextureHeight;
906
905
  private capeTextureSrc?;
@@ -900,7 +900,6 @@ declare class SkinObject extends SceneObject {
900
900
  readonly options: SkinObjectOptions;
901
901
  private slim;
902
902
  private legacy;
903
- private skinTextureSrc?;
904
903
  private skinTextureWidth;
905
904
  private skinTextureHeight;
906
905
  private capeTextureSrc?;
@@ -5605,7 +5605,41 @@ var baseSkinCoordinates = {
5605
5605
  var classicSkinTextureCoordinates = {
5606
5606
  ...baseSkinCoordinates
5607
5607
  };
5608
- var slimSkinTextureCoordinates = { ...baseSkinCoordinates };
5608
+ var slimSkinTextureCoordinates = {
5609
+ ...baseSkinCoordinates,
5610
+ leftArm: {
5611
+ ...baseSkinCoordinates.leftArm,
5612
+ west: { uv: [39, 52, 43, 64] },
5613
+ north: { uv: [36, 52, 39, 64] },
5614
+ south: { uv: [43, 52, 46, 64] },
5615
+ up: { uv: [39, 52, 36, 48] },
5616
+ down: { uv: [42, 48, 39, 52] }
5617
+ },
5618
+ rightArm: {
5619
+ ...baseSkinCoordinates.rightArm,
5620
+ west: { uv: [47, 20, 51, 32] },
5621
+ north: { uv: [44, 20, 47, 32] },
5622
+ south: { uv: [51, 20, 54, 32] },
5623
+ up: { uv: [47, 20, 44, 16] },
5624
+ down: { uv: [50, 16, 47, 20] }
5625
+ },
5626
+ leftSleeve: {
5627
+ ...baseSkinCoordinates.leftSleeve,
5628
+ west: { uv: [55, 52, 59, 64] },
5629
+ north: { uv: [52, 52, 55, 64] },
5630
+ south: { uv: [59, 52, 62, 64] },
5631
+ up: { uv: [55, 52, 52, 48] },
5632
+ down: { uv: [58, 48, 55, 52], rotation: 180 }
5633
+ },
5634
+ rightSleeve: {
5635
+ ...baseSkinCoordinates.rightSleeve,
5636
+ west: { uv: [47, 36, 51, 48] },
5637
+ north: { uv: [44, 36, 47, 48] },
5638
+ south: { uv: [51, 36, 54, 48] },
5639
+ up: { uv: [47, 36, 44, 32] },
5640
+ down: { uv: [50, 32, 47, 36], rotation: 180 }
5641
+ }
5642
+ };
5609
5643
 
5610
5644
  // src/skin/SkinGeometries.ts
5611
5645
  var box8inner = [8, 8, 8];
@@ -5715,7 +5749,6 @@ var SkinObject = class extends SceneObject {
5715
5749
  }
5716
5750
  setSkinTexture(src) {
5717
5751
  if (typeof src === "undefined") return;
5718
- this.skinTextureSrc = src;
5719
5752
  const mat = Materials.getImage({
5720
5753
  texture: { src },
5721
5754
  transparent: true
@@ -5729,18 +5762,18 @@ var SkinObject = class extends SceneObject {
5729
5762
  }
5730
5763
  //TODO: cape
5731
5764
  setSlim(slim) {
5732
- console.log("#setSlim");
5733
- const changed = slim !== this.slim;
5765
+ if (slim === this.slim) return;
5734
5766
  this.slim = slim;
5735
- if (changed) {
5736
- this.createMeshes();
5737
- }
5738
- if (changed) {
5739
- if (this.skinTextureSrc) {
5740
- this.setSkinTexture(this.skinTextureSrc);
5741
- }
5742
- }
5743
- console.log("#setSlim done");
5767
+ for (const part of ["leftArm" /* LEFT_ARM */, "leftSleeve" /* LEFT_SLEEVE */, "rightArm" /* RIGHT_ARM */, "rightSleeve" /* RIGHT_SLEEVE */]) {
5768
+ const mesh = this.getMeshByName(part);
5769
+ if (mesh) mesh.geometry = this.getBoxGeometry(part);
5770
+ }
5771
+ const offset = slim ? 0.5 : -0.5;
5772
+ const leftArm = this.getGroupByName("leftArm" /* LEFT_ARM */);
5773
+ const rightArm = this.getGroupByName("rightArm" /* RIGHT_ARM */);
5774
+ if (leftArm) leftArm.position.x += offset;
5775
+ if (rightArm) rightArm.position.x -= offset;
5776
+ this.notifyDirty();
5744
5777
  }
5745
5778
  setLegacy(legacy) {
5746
5779
  if (legacy !== this.legacy) {