Fixed crash with Optifine. Fixes #1875
This commit is contained in:
@@ -110,6 +110,10 @@ public class BakedModelFullbright extends BakedModelDelegate {
|
||||
}
|
||||
|
||||
private static BakedQuad transformQuad(BakedQuad quad, float light) {
|
||||
if (RenderUtils.isLightMapDisabled()) {
|
||||
return quad;
|
||||
}
|
||||
|
||||
VertexFormat newFormat = RenderUtils.getFormatWithLightMap(quad.getFormat());
|
||||
|
||||
UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(newFormat);
|
||||
|
||||
@@ -404,8 +404,12 @@ public final class RenderUtils {
|
||||
return lines;
|
||||
}
|
||||
|
||||
public static boolean isLightMapDisabled() {
|
||||
return FMLClientHandler.instance().hasOptifine() || !ForgeModContainer.forgeLightPipelineEnabled;
|
||||
}
|
||||
|
||||
public static VertexFormat getFormatWithLightMap(VertexFormat format) {
|
||||
if (FMLClientHandler.instance().hasOptifine() || !ForgeModContainer.forgeLightPipelineEnabled) {
|
||||
if (isLightMapDisabled()) {
|
||||
return format;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user