Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ public List<BakedQuad> getFacadeQuads(BlockStateModel facadeModel, BlockState bl
}

private void addFacadeQuad(List<BakedQuad> quads, BakedQuad originalQuad, float u0, float v0, float u1, float v1, Direction side) {
// MODEL_BAKER is populated lazily when the cable *item* model is baked (see ItemModelCable.Unbaked#bake).
// Under deferred/lazy model baking (e.g. ModernFix's dynamic_resources) that may not have happened yet when a
// chunk section containing a facade is first meshed, leaving MODEL_BAKER null and crashing FaceBakery#bakeQuad.
// Skip the facade quad in that case instead of crashing; it will render once the item model has been baked.
if (MODEL_BAKER == null) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a solution, since this will just make facades invisible.

return;
}
Vector3f from = new Vector3f(u0 * 16f, v0 * 16f, 0f);
Vector3f to = new Vector3f(u1 * 16f, v1 * 16f, 0f);
TextureAtlasSprite texture = originalQuad.materialInfo().sprite();
Expand Down