Skip to content

Commit

Permalink
Better fix, didn't work previously since I mixed up == and !=
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Apr 5, 2024
1 parent cba27f1 commit 8309a67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,18 @@ public void emitBlockQuads(BlockAndTintGetter blockView, BlockState state, Block
}
}

// fabric: If it is the default state do not push transformations, will cause issues with GhostBlockRenderer
boolean shouldTransform = material != AllBlocks.COPYCAT_BASE.getDefaultState();

// fabric: need to change the default render material
context.pushTransform(MaterialFixer.create(material));
if (shouldTransform)
context.pushTransform(MaterialFixer.create(material));

emitBlockQuadsInner(blockView, state, pos, randomSupplier, context, material, cullFaceRemovalData, occlusionData);

// fabric: pop the material changer transform
context.popTransform();
if (shouldTransform)
context.popTransform();
}

protected abstract void emitBlockQuadsInner(BlockAndTintGetter blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context, BlockState material, CullFaceRemovalData cullFaceRemovalData, OcclusionData occlusionData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ public void render(PoseStack ms, SuperRenderTypeBuffer buffer, Vec3 camera, Ghos
ms.scale(.85f, .85f, .85f);
ms.translate(-.5, -.5, -.5);

// fabric: https://github.com/Fabricators-of-Create/Create/commit/3db14dfda90bba726514855f2d4f46dab0be40d6
// due to the changes in that commit this needs to be done otherwise DefaultLayerFilteringBakedModel's
// hasDefaultBlendMode will return false on copycats making placement helpers for any copycat block fail to appear.
if (!(model instanceof CopycatModel))
model = DefaultLayerFilteringBakedModel.wrap(model);
model = DefaultLayerFilteringBakedModel.wrap(model);
model = FixedLightBakedModel.wrap(model, LevelRenderer.getLightColor(mc.level, pos));
model = TranslucentBakedModel.wrap(model, () -> params.alphaSupplier.get() * .75f * PlacementHelpers.getCurrentAlpha());
dispatcher.getModelRenderer()
Expand Down

0 comments on commit 8309a67

Please sign in to comment.