From 1112819fc8d8e31c5d3a6c3cc5ef41e020774b50 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Thu, 25 Nov 2021 10:14:12 +0000 Subject: [PATCH] Fix render pipeline lighting issue with small cubes (#8158) This will also allow other mods which need to calculate small normalised vectors to be able to use the default classes without needing to write their own, while not effecting any side effects created by how the base game uses this function. --- patches/minecraft/com/mojang/math/Vector3f.java.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patches/minecraft/com/mojang/math/Vector3f.java.patch b/patches/minecraft/com/mojang/math/Vector3f.java.patch index 726d301663..5fce3b3cf3 100644 --- a/patches/minecraft/com/mojang/math/Vector3f.java.patch +++ b/patches/minecraft/com/mojang/math/Vector3f.java.patch @@ -1,5 +1,14 @@ --- a/com/mojang/math/Vector3f.java +++ b/com/mojang/math/Vector3f.java +@@ -138,7 +_,7 @@ + + public boolean m_122278_() { + float f = this.f_122228_ * this.f_122228_ + this.f_122229_ * this.f_122229_ + this.f_122230_ * this.f_122230_; +- if ((double)f < 1.0E-5D) { ++ if (f < Float.MIN_NORMAL) { //Forge: Fix MC-239212 + return false; + } else { + float f1 = Mth.m_14195_(f); @@ -207,4 +_,16 @@ public String toString() { return "[" + this.f_122228_ + ", " + this.f_122229_ + ", " + this.f_122230_ + "]";