From 071664d95f98c3a874a9e94a8297a95587859558 Mon Sep 17 00:00:00 2001 From: Ben Staddon Date: Tue, 3 Oct 2017 00:02:31 +0100 Subject: [PATCH] Fix being unable to see with night vision under some conditions (#4383) --- .../client/renderer/EntityRenderer.java.patch | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index 9695b0bcf..727816ff2 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -223,7 +223,17 @@ float f13 = this.field_78535_ad + (this.field_78539_ae - this.field_78535_ad) * p_78466_1_; this.field_175080_Q *= f13; -@@ -1845,6 +1868,13 @@ +@@ -1830,6 +1853,9 @@ + f6 = 1.0F / this.field_175081_S; + } + ++ // Forge: fix MC-4647 and MC-10480 ++ if (Float.isInfinite(f6)) f6 = Math.nextAfter(f6, 0.0); ++ + this.field_175080_Q = this.field_175080_Q * (1.0F - f15) + this.field_175080_Q * f6 * f15; + this.field_175082_R = this.field_175082_R * (1.0F - f15) + this.field_175082_R * f6 * f15; + this.field_175081_S = this.field_175081_S * (1.0F - f15) + this.field_175081_S * f6 * f15; +@@ -1845,6 +1871,13 @@ this.field_175081_S = f7; } @@ -237,7 +247,7 @@ GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F); } -@@ -1855,7 +1885,9 @@ +@@ -1855,7 +1888,9 @@ GlStateManager.func_187432_a(0.0F, -1.0F, 0.0F); GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78468_2_); @@ -248,7 +258,7 @@ if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q)) { float f1 = 5.0F; -@@ -1940,6 +1972,7 @@ +@@ -1940,6 +1975,7 @@ GlStateManager.func_179102_b(f * 0.05F); GlStateManager.func_179153_c(Math.min(f, 192.0F) * 0.5F); }