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.
@@ -901,7 +901,6 @@ declare class SkinObject extends SceneObject {
901
901
  readonly options: SkinObjectOptions;
902
902
  private slim;
903
903
  private legacy;
904
- private skinTextureSrc?;
905
904
  private skinTextureWidth;
906
905
  private skinTextureHeight;
907
906
  private capeTextureSrc?;
@@ -901,7 +901,6 @@ declare class SkinObject extends SceneObject {
901
901
  readonly options: SkinObjectOptions;
902
902
  private slim;
903
903
  private legacy;
904
- private skinTextureSrc?;
905
904
  private skinTextureWidth;
906
905
  private skinTextureHeight;
907
906
  private capeTextureSrc?;
@@ -5650,7 +5650,41 @@ var baseSkinCoordinates = {
5650
5650
  var classicSkinTextureCoordinates = {
5651
5651
  ...baseSkinCoordinates
5652
5652
  };
5653
- var slimSkinTextureCoordinates = { ...baseSkinCoordinates };
5653
+ var slimSkinTextureCoordinates = {
5654
+ ...baseSkinCoordinates,
5655
+ leftArm: {
5656
+ ...baseSkinCoordinates.leftArm,
5657
+ west: { uv: [39, 52, 43, 64] },
5658
+ north: { uv: [36, 52, 39, 64] },
5659
+ south: { uv: [43, 52, 46, 64] },
5660
+ up: { uv: [39, 52, 36, 48] },
5661
+ down: { uv: [42, 48, 39, 52] }
5662
+ },
5663
+ rightArm: {
5664
+ ...baseSkinCoordinates.rightArm,
5665
+ west: { uv: [47, 20, 51, 32] },
5666
+ north: { uv: [44, 20, 47, 32] },
5667
+ south: { uv: [51, 20, 54, 32] },
5668
+ up: { uv: [47, 20, 44, 16] },
5669
+ down: { uv: [50, 16, 47, 20] }
5670
+ },
5671
+ leftSleeve: {
5672
+ ...baseSkinCoordinates.leftSleeve,
5673
+ west: { uv: [55, 52, 59, 64] },
5674
+ north: { uv: [52, 52, 55, 64] },
5675
+ south: { uv: [59, 52, 62, 64] },
5676
+ up: { uv: [55, 52, 52, 48] },
5677
+ down: { uv: [58, 48, 55, 52], rotation: 180 }
5678
+ },
5679
+ rightSleeve: {
5680
+ ...baseSkinCoordinates.rightSleeve,
5681
+ west: { uv: [47, 36, 51, 48] },
5682
+ north: { uv: [44, 36, 47, 48] },
5683
+ south: { uv: [51, 36, 54, 48] },
5684
+ up: { uv: [47, 36, 44, 32] },
5685
+ down: { uv: [50, 32, 47, 36], rotation: 180 }
5686
+ }
5687
+ };
5654
5688
 
5655
5689
  // src/skin/SkinGeometries.ts
5656
5690
  var box8inner = [8, 8, 8];
@@ -5760,7 +5794,6 @@ var SkinObject = class extends SceneObject {
5760
5794
  }
5761
5795
  setSkinTexture(src) {
5762
5796
  if (typeof src === "undefined") return;
5763
- this.skinTextureSrc = src;
5764
5797
  const mat = Materials.getImage({
5765
5798
  texture: { src },
5766
5799
  transparent: true
@@ -5774,18 +5807,18 @@ var SkinObject = class extends SceneObject {
5774
5807
  }
5775
5808
  //TODO: cape
5776
5809
  setSlim(slim) {
5777
- console.log("#setSlim");
5778
- const changed = slim !== this.slim;
5810
+ if (slim === this.slim) return;
5779
5811
  this.slim = slim;
5780
- if (changed) {
5781
- this.createMeshes();
5782
- }
5783
- if (changed) {
5784
- if (this.skinTextureSrc) {
5785
- this.setSkinTexture(this.skinTextureSrc);
5786
- }
5787
- }
5788
- console.log("#setSlim done");
5812
+ for (const part of ["leftArm" /* LEFT_ARM */, "leftSleeve" /* LEFT_SLEEVE */, "rightArm" /* RIGHT_ARM */, "rightSleeve" /* RIGHT_SLEEVE */]) {
5813
+ const mesh = this.getMeshByName(part);
5814
+ if (mesh) mesh.geometry = this.getBoxGeometry(part);
5815
+ }
5816
+ const offset = slim ? 0.5 : -0.5;
5817
+ const leftArm = this.getGroupByName("leftArm" /* LEFT_ARM */);
5818
+ const rightArm = this.getGroupByName("rightArm" /* RIGHT_ARM */);
5819
+ if (leftArm) leftArm.position.x += offset;
5820
+ if (rightArm) rightArm.position.x -= offset;
5821
+ this.notifyDirty();
5789
5822
  }
5790
5823
  setLegacy(legacy) {
5791
5824
  if (legacy !== this.legacy) {