From 114b9568cdee74f9095ddcc634f87c88b438f124 Mon Sep 17 00:00:00 2001 From: Luna0x01 Date: Mon, 30 Dec 2024 13:06:32 +0530 Subject: [PATCH] set normal to 0 if somehow quad doesn't have normal data --- .../mods/sodium/client/model/quad/ModelQuadView.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/net/caffeinemc/mods/sodium/client/model/quad/ModelQuadView.java b/common/src/main/java/net/caffeinemc/mods/sodium/client/model/quad/ModelQuadView.java index 00a11f919..7d8aa576d 100644 --- a/common/src/main/java/net/caffeinemc/mods/sodium/client/model/quad/ModelQuadView.java +++ b/common/src/main/java/net/caffeinemc/mods/sodium/client/model/quad/ModelQuadView.java @@ -123,7 +123,13 @@ default int calculateNormal() { * @return the per-vertex normal if it is set, otherwise the face normal. */ default int getAccurateNormal(int i) { - int normal = getVertexNormal(i); + int normal; + + try { + normal = getVertexNormal(i); + } catch (final Exception e) { + normal = 0; + } return normal == 0 ? getFaceNormal() : normal; }