Skip to content

Commit

Permalink
Add note about multipart optimization quirk
Browse files Browse the repository at this point in the history
Related: #380
  • Loading branch information
embeddedt committed Sep 7, 2024
1 parent 4895003 commit 0da5ede
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ public List<BakedQuad> getQuads(BlockState state, Direction face, RandomSource r
random.setSeed(seed);

// Embeddium: Filter render types as Forge does, but only if we actually need to do so. This avoids
// the overhead of getRenderTypes() for all vanilla models.
// the overhead of getRenderTypes() for all vanilla models. This optimization breaks mods that blindly call
// MultiPartBakedModel#getQuads() on all render types rather than just the ones returned by getRenderTypes().
// The original implementation accidentally handled these as a result of doing the filtering in getQuads.
// We consider this a worthwhile tradeoff, because the API contract for chunk meshing requires iterating over
// the return value of getRenderTypes(). To date, only Windowlogged is known to be broken by this change.
if (!checkSubmodelTypes || renderLayer == null || model.getRenderTypes(state, random, modelData).contains(renderLayer)) {
List<BakedQuad> submodelQuads = model.getQuads(state, face, random, MultipartModelData.resolve(modelData, model), renderLayer);
if(models.length == 1) {
Expand Down

0 comments on commit 0da5ede

Please sign in to comment.