From c2b78f8e0ea56d790a846ef595068d0967540839 Mon Sep 17 00:00:00 2001 From: PepperCode1 <44146161+PepperCode1@users.noreply.github.com> Date: Wed, 20 Jul 2022 08:51:50 -0700 Subject: [PATCH] Fix BakedModelBuilder not wrapping models --- .../com/jozufozu/flywheel/core/model/BakedModelBuilder.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/jozufozu/flywheel/core/model/BakedModelBuilder.java b/src/main/java/com/jozufozu/flywheel/core/model/BakedModelBuilder.java index b8956b462..14e59af85 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/BakedModelBuilder.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/BakedModelBuilder.java @@ -4,6 +4,7 @@ package com.jozufozu.flywheel.core.model; import java.util.Random; import com.jozufozu.flywheel.core.virtual.VirtualEmptyBlockGetter; +import com.jozufozu.flywheel.fabric.model.DefaultLayerFilteringBakedModel; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -42,6 +43,10 @@ public final class BakedModelBuilder implements Bufferable { @Override public void bufferInto(ModelBlockRenderer blockRenderer, VertexConsumer consumer, Random random) { + BakedModel model = DefaultLayerFilteringBakedModel.wrap(this.model); + if (consumer instanceof ShadeSeparatingVertexConsumer shadeSeparatingWrapper) { + model = shadeSeparatingWrapper.wrapModel(model); + } blockRenderer.tesselateBlock(renderWorld, model, referenceState, BlockPos.ZERO, poseStack, consumer, false, random, 42, OverlayTexture.NO_OVERLAY); } }