diff --git a/src/main/java/net/minecraftforge/client/model/pipeline/VertexLighterFlat.java b/src/main/java/net/minecraftforge/client/model/pipeline/VertexLighterFlat.java index b9419b9ed..4ac61e844 100644 --- a/src/main/java/net/minecraftforge/client/model/pipeline/VertexLighterFlat.java +++ b/src/main/java/net/minecraftforge/client/model/pipeline/VertexLighterFlat.java @@ -121,14 +121,14 @@ public class VertexLighterFlat extends QuadGatheringTransformer float[][] lightmap = quadData[lightmapIndex]; float[][] color = quadData[colorIndex]; - // If all three normal values are either -1 or 0, normals must be generated - if(quadData[normalIndex][0][0] != quadData[normalIndex][0][1] || - quadData[normalIndex][0][1] != quadData[normalIndex][0][2] || - (quadData[normalIndex][0][0] != -1 && quadData[normalIndex][0][0] != 0)) + if (dataLength[normalIndex] >= 3 + && (quadData[normalIndex][0][0] != -1 + || quadData[normalIndex][0][1] != -1 + || quadData[normalIndex][0][2] != -1)) { normal = quadData[normalIndex]; } - else + else // normals must be generated { normal = new float[4][4]; Vector3f v1 = new Vector3f(position[3]);