From 7258beeede608b0512b744beb5e01bd5dbca3811 Mon Sep 17 00:00:00 2001 From: Ben Staddon Date: Wed, 20 Jun 2018 20:36:10 +0100 Subject: [PATCH] Fix vertex lighter using stale normal data (#4917) --- .../client/model/pipeline/VertexLighterFlat.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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]);