Fixed crash with Optifine. Fixes #1875

This commit is contained in:
raoulvdberge
2018-07-13 23:28:46 +02:00
parent 466416203e
commit d311269d3c
2 changed files with 9 additions and 1 deletions

View File

@@ -110,6 +110,10 @@ public class BakedModelFullbright extends BakedModelDelegate {
} }
private static BakedQuad transformQuad(BakedQuad quad, float light) { private static BakedQuad transformQuad(BakedQuad quad, float light) {
if (RenderUtils.isLightMapDisabled()) {
return quad;
}
VertexFormat newFormat = RenderUtils.getFormatWithLightMap(quad.getFormat()); VertexFormat newFormat = RenderUtils.getFormatWithLightMap(quad.getFormat());
UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(newFormat); UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(newFormat);

View File

@@ -404,8 +404,12 @@ public final class RenderUtils {
return lines; return lines;
} }
public static boolean isLightMapDisabled() {
return FMLClientHandler.instance().hasOptifine() || !ForgeModContainer.forgeLightPipelineEnabled;
}
public static VertexFormat getFormatWithLightMap(VertexFormat format) { public static VertexFormat getFormatWithLightMap(VertexFormat format) {
if (FMLClientHandler.instance().hasOptifine() || !ForgeModContainer.forgeLightPipelineEnabled) { if (isLightMapDisabled()) {
return format; return format;
} }