From 875a5e2ce9b184e0b97352bb98d1406fbbb27976 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 16 Feb 2023 19:50:03 +0000 Subject: [PATCH] Fixed z-fighting between pony wings and dual saddlebags --- .../client/model/gear/SaddleBags.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java b/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java index 04990c64..a276fb4f 100644 --- a/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java +++ b/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java @@ -63,6 +63,7 @@ public class SaddleBags extends AbstractWearableGear implements PonyModelConstan leftBag.visible = wearable == Wearable.SADDLE_BAGS_BOTH || wearable == Wearable.SADDLE_BAGS_LEFT; rightBag.visible = wearable == Wearable.SADDLE_BAGS_BOTH || wearable == Wearable.SADDLE_BAGS_RIGHT; + strap.visible = wearable == Wearable.SADDLE_BAGS_BOTH; dropAmount = hangLow ? 0.15F : 0; dropAmount = model.getMetadata().getInterpolator(interpolatorId).interpolate("dropAmount", dropAmount, 3); @@ -70,10 +71,16 @@ public class SaddleBags extends AbstractWearableGear implements PonyModelConstan @Override public void render(MatrixStack stack, VertexConsumer renderContext, int overlayUv, int lightUv, float red, float green, float blue, float alpha, UUID interpolatorId) { + + stack.push(); + if (wearable == Wearable.SADDLE_BAGS_BOTH) { + stack.translate(0, 0, -0.2F); + } + stack.push(); stack.translate(0, dropAmount, 0); - if (!rightBag.visible || !leftBag.visible) { + if (wearable != Wearable.SADDLE_BAGS_BOTH) { stack.translate(0, 0.3F, -0.3F); } @@ -81,8 +88,8 @@ public class SaddleBags extends AbstractWearableGear implements PonyModelConstan rightBag.render(stack, renderContext, overlayUv, lightUv, red, green, blue, alpha); stack.pop(); - if (leftBag.visible && rightBag.visible) { - strap.render(stack, renderContext, overlayUv, lightUv, red, green, blue, alpha); - } + strap.render(stack, renderContext, overlayUv, lightUv, red, green, blue, alpha); + + stack.pop(); } }