public record ItemQuads(List<BakedQuad> all, List<BakedQuad> solid, List<BakedQuad> translucent) {
10
public static final ItemQuads EMPTY = new ItemQuads(List.of(), List.of(), List.of());
11
12
public static ItemQuads split(final List<BakedQuad> quads) {
13
if (quads.isEmpty()) {
14
return EMPTY;
15
}
16
17
List<BakedQuad> solid = new ArrayList<>();
18
List<BakedQuad> translucent = new ArrayList<>();
19
20
for (BakedQuad quad : quads) {
21
if (quad.materialInfo().itemRenderType().hasBlending()) {
22
translucent.add(quad);
23
} else {
24
solid.add(quad);
25
}
26
}
27
28
if (translucent.isEmpty()) {
29
List<BakedQuad> all = List.copyOf(quads);
30
return new ItemQuads(all, all, List.of());
31
} else if (solid.isEmpty()) {
32
List<BakedQuad> all = List.copyOf(quads);
33
return new ItemQuads(all, List.of(), all);
34
} else {
35
return new ItemQuads(List.copyOf(quads), List.copyOf(solid), List.copyOf(translucent));
36
}
37
}
38
39
public boolean isEmpty() {
40
return this.all.isEmpty();
41
}
42
}
43
Decompiled Minecraft 26.3 source of ItemQuads (net/minecraft/client/resources/model/geometry/ItemQuads.java) with Mojang official mappings, stored verbatim on the site.