Skip to content

Commit 67643c8

Browse files
committed
Fix #7
I forgot to actually check the transparency value lol Signed-off-by: roadhog360 <[email protected]>
1 parent 1c42fd4 commit 67643c8

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/main/java/roadhog360/simpleskinbackport/mixins/early/MixinModelBiped.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ private void checkPlayerModelAndSetDim(ModelBiped instance, int value, Operation
7676

7777
@Inject(method = "<init>(FFII)V", at = @At("TAIL"))
7878
private void injectNewLimbs(float size, float p_i1149_2_, int texWidth, int texHeight, CallbackInfo ci) {
79-
Utils.setAllBoxesTransparent(bipedHeadwear);
8079
if (simpleSkinBackport$isPlayerModel() && textureWidth == 64 && (textureHeight == 32 || textureHeight == 64)) {
80+
Utils.setAllBoxesTransparent(bipedHeadwear);
8181
simpleSkinBackport$setupBoxes();
8282
simpleSkinBackport$createArmBoxes();
8383
}
@@ -103,6 +103,7 @@ private void injectNewLimbs(float size, float p_i1149_2_, int texWidth, int texH
103103

104104
bipedLeftArm.mirror = false;
105105
Utils.changeTextureOffset(bipedLeftArm, 32, 48);
106+
//Right arm is fine as it is and doesn't need any transformation.
106107

107108
simpleSkinBackport$bipedLeftArmwear = Utils.cloneModel(this, bipedLeftArm, 48, 48, true, Utils.BoxTransformType.HAT);
108109
simpleSkinBackport$bipedRightArmwear = Utils.cloneModel(this, bipedRightArm, 40, 32, true, Utils.BoxTransformType.HAT);
@@ -155,6 +156,10 @@ private void injectNewLimbs(float size, float p_i1149_2_, int texWidth, int texH
155156

156157
@Override
157158
public void simpleSkinBackport$setSlim(boolean slim) {
159+
// if(!simpleSkinBackport$isPlayerModel()) {
160+
// simpleSkinBackport$set64x();
161+
// simpleSkinBackport$setPlayerModel(true);
162+
// }
158163
if(simpleSkinBackport$isPlayerModel()) {
159164
if (ConfigMain.oldSlimArms) {
160165
if (slim) {

src/main/java/roadhog360/simpleskinbackport/mixins/early/MixinModelBox.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import roadhog360.simpleskinbackport.ducks.ITransparentBox;
1212

1313
@Mixin(ModelBox.class)
14-
public class MixinModelBox implements ITransparentBox, Cloneable {
14+
public class MixinModelBox implements ITransparentBox {
1515

1616
@Unique
1717
private boolean simpleSkinBackport$isTransparent;
@@ -28,12 +28,16 @@ public class MixinModelBox implements ITransparentBox, Cloneable {
2828

2929
@Inject(method = "render", at = @At(value = "HEAD"))
3030
private void doTransparency(Tessellator p_78245_1_, float p_78245_2_, CallbackInfo ci) {
31-
GL11.glEnable(GL11.GL_BLEND);
32-
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
31+
if(simpleSkinBackport$isTransparent()) {
32+
GL11.glEnable(GL11.GL_BLEND);
33+
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
34+
}
3335
}
3436

3537
@Inject(method = "render", at = @At(value = "TAIL"))
3638
private void finishTransparency(Tessellator p_78245_1_, float p_78245_2_, CallbackInfo ci) {
37-
GL11.glDisable(GL11.GL_BLEND);
39+
if(simpleSkinBackport$isTransparent()) {
40+
GL11.glDisable(GL11.GL_BLEND);
41+
}
3842
}
3943
}

0 commit comments

Comments
 (0)