Skip to content

Commit 73e271b

Browse files
fix hat for 64x32
1 parent e3ee5a5 commit 73e271b

2 files changed

Lines changed: 91 additions & 50 deletions

File tree

src/skin/index.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -441,17 +441,15 @@ function createPlayerModel(skinTexture, capeTexture, v, slim, capeType) {
441441
);
442442
head.translateOnAxis(new THREE.Vector3(0, 1, 0), 4);
443443
headGroup.add(head);
444-
if (v >= 1) {
445-
let hat = createCube(skinTexture,
446-
8.504, 8.504, 8.504,
447-
texturePositions.hat,
448-
slim,
449-
"hat",
450-
true
451-
);
452-
hat.translateOnAxis(new THREE.Vector3(0, 1, 0), 4);
453-
headGroup.add(hat);
454-
}
444+
let hat = createCube(skinTexture,
445+
8.504, 8.504, 8.504,
446+
texturePositions.hat[v],
447+
slim,
448+
"hat",
449+
true
450+
);
451+
hat.translateOnAxis(new THREE.Vector3(0, 1, 0), 4);
452+
headGroup.add(hat);
455453

456454
let bodyGroup = new THREE.Object3D();
457455
bodyGroup.name = "bodyGroup";

src/skin/texturePositions.js

Lines changed: 82 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -556,47 +556,90 @@ const texturePositions = {
556556
}
557557
],
558558

559-
hat: {
560-
left: {
561-
x: 32,
562-
y: 48,
563-
w: 8,
564-
h: 8
565-
},
566-
front: {
567-
x: 40,
568-
y: 48,
569-
w: 8,
570-
h: 8
571-
},
572-
right: {
573-
x: 48,
574-
y: 48,
575-
w: 8,
576-
h: 8
577-
},
578-
back: {
579-
x: 56,
580-
y: 48,
581-
w: 8,
582-
h: 8
583-
},
584-
top: {
585-
x: 40,
586-
y: 56,
587-
w: 8,
588-
h: 8,
589-
flipX: false
559+
hat: [
560+
{ // 64x32
561+
left: {
562+
x: 32,
563+
y: 16,
564+
w: 8,
565+
h: 8
566+
},
567+
front: {
568+
x: 40,
569+
y: 16,
570+
w: 8,
571+
h: 8
572+
},
573+
right: {
574+
x: 48,
575+
y: 16,
576+
w: 8,
577+
h: 8
578+
},
579+
back: {
580+
x: 56,
581+
y: 16,
582+
w: 8,
583+
h: 8
584+
},
585+
top: {
586+
x: 40,
587+
y: 24,
588+
w: 8,
589+
h: 8,
590+
flipX: false
591+
},
592+
bottom: {
593+
x: 48,
594+
y: 24,
595+
w: 8,
596+
h: 8,
597+
flipY: true,
598+
flipX: true
599+
}
590600
},
591-
bottom: {
592-
x: 48,
593-
y: 56,
594-
w: 8,
595-
h: 8,
596-
flipY: true,
597-
flipX: true
601+
{ // 64x64
602+
left: {
603+
x: 32,
604+
y: 48,
605+
w: 8,
606+
h: 8
607+
},
608+
front: {
609+
x: 40,
610+
y: 48,
611+
w: 8,
612+
h: 8
613+
},
614+
right: {
615+
x: 48,
616+
y: 48,
617+
w: 8,
618+
h: 8
619+
},
620+
back: {
621+
x: 56,
622+
y: 48,
623+
w: 8,
624+
h: 8
625+
},
626+
top: {
627+
x: 40,
628+
y: 56,
629+
w: 8,
630+
h: 8,
631+
flipX: false
632+
},
633+
bottom: {
634+
x: 48,
635+
y: 56,
636+
w: 8,
637+
h: 8,
638+
flipY: true,
639+
flipX: true
640+
}
598641
}
599-
},
642+
],
600643
jacket: {
601644
left: {
602645
x: 16,

0 commit comments

Comments
 (0)