Skip to content

Commit

Permalink
Fix firstperson arm layers in older versions. Fix #190
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Nov 4, 2024
1 parent 0492a29 commit 8c153a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void render(PoseStack poseStack, VertexConsumer vertexConsumer, int light

@Override
public void setInjectedMesh(Mesh mesh, OffsetProvider offsetProvider) {
injectedMesh = mesh;
this.injectedMesh = mesh;
this.offsetProvider = offsetProvider;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.player.PlayerModelPart;
import net.minecraft.world.item.ItemStack;

@Mixin(PlayerRenderer.class)
Expand All @@ -50,6 +51,8 @@ public abstract class PlayerRendererMixin
//#endif
// spotless:on

private boolean setupFirstpersonArms = false;

// spotless:off
//#if MC >= 11700
public PlayerRendererMixin(Context context, PlayerModel entityModel, float f) {
Expand Down Expand Up @@ -147,7 +150,8 @@ public void extractRenderState(AbstractClientPlayer abstractClientPlayer, Player
//$$ // fall back to vanilla
//$$ return;
//$$ }
//$$ if (SkinLayersModBase.config.compatibilityMode) {
//$$ if (SkinLayersModBase.config.compatibilityMode || setupFirstpersonArms) {
//$$ setupFirstpersonArms = false;
//$$ // Inject layers into the vanilla model
//$$ ItemStack itemStack = abstractClientPlayer.getItemBySlot(EquipmentSlot.HEAD);
//$$ if (SkinLayersModBase.config.enableHat && (itemStack == null
Expand Down Expand Up @@ -216,6 +220,7 @@ private void renderHandStart(PoseStack poseStack, MultiBufferSource multiBufferS
// fall back to vanilla
return;
}
setupFirstpersonArms = true;
if (arm == getModel().leftArm) {
if (SkinLayersModBase.config.enableLeftSleeve) {
((ModelPartInjector) (Object) sleeve).setInjectedMesh(settings.getLeftArmMesh(),
Expand Down

0 comments on commit 8c153a3

Please sign in to comment.