Skip to content

Commit

Permalink
Merge pull request #522 from P3pp3rF1y/1.21.x-dev
Browse files Browse the repository at this point in the history
fix: 🐛 Fixed z-fighting on chest lid when the lid opens into another …
  • Loading branch information
P3pp3rF1y authored Nov 6, 2024
2 parents 80a3ea7 + f838fb1 commit 7bb785a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ loader_version_range=[4,)
mod_id=sophisticatedstorage
mod_name=Sophisticated Storage
mod_license=GNU General Public License v3.0
mod_version=0.10.48
mod_version=0.10.49
mod_group_id=sophisticatedstorage
mod_authors=P3pp3rF1y, Ridanisaurus
mod_description=Fancy and functional storage containers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ private void renderHiddenTier(PoseStack poseStack, MultiBufferSource bufferSourc

int color = 0x7F_FFFFFF;

lidPart.render(poseStack, translucentConsumer, packedLight, packedOverlay, 0x7F_FFFFFF);
bottomPart.render(poseStack, translucentConsumer, packedLight, packedOverlay, 0x7F_FFFFFF);
lidPart.render(poseStack, translucentConsumer, packedLight, packedOverlay, color);
bottomPart.render(poseStack, translucentConsumer, packedLight, packedOverlay, color);
poseStack.popPose();
}

Expand All @@ -254,7 +254,15 @@ private void renderBottomAndLid(PoseStack poseStack, MultiBufferSource bufferSou

private void renderBottomAndLid(PoseStack poseStack, float lidAngle, int packedLight, int packedOverlay, VertexConsumer consumer) {
lidPart.xRot = -(lidAngle * ((float) Math.PI / 2F));
if (lidAngle > 0) {
poseStack.pushPose();
poseStack.translate(-0.0005F, -0.001F, -0.0005F);
poseStack.scale(1.001F, 1.001F, 1.001F);
}
lidPart.render(poseStack, consumer, packedLight, packedOverlay);
if (lidAngle > 0) {
poseStack.popPose();
}
bottomPart.render(poseStack, consumer, packedLight, packedOverlay);
}

Expand All @@ -263,7 +271,15 @@ private void renderBottomAndLidWithTint(PoseStack poseStack, MultiBufferSource b
lidPart.xRot = -(lidAngle * ((float) Math.PI / 2F));
int color = 0xFF_000000 | tint;

if (lidAngle > 0) {
poseStack.pushPose();
poseStack.translate(-0.0005F, -0.001F, -0.0005F);
poseStack.scale(1.001F, 1.001F, 1.001F);
}
lidPart.render(poseStack, consumer, packedLight, packedOverlay, color);
if (lidAngle > 0) {
poseStack.popPose();
}
bottomPart.render(poseStack, consumer, packedLight, packedOverlay, color);
}

Expand Down

0 comments on commit 7bb785a

Please sign in to comment.