Fix being unable to see with night vision under some conditions (#4383)

This commit is contained in:
Ben Staddon 2017-10-03 00:02:31 +01:00 committed by LexManos
parent 5cddcc0280
commit 071664d95f

View file

@ -223,7 +223,17 @@
float f13 = this.field_78535_ad + (this.field_78539_ae - this.field_78535_ad) * p_78466_1_; float f13 = this.field_78535_ad + (this.field_78539_ae - this.field_78535_ad) * p_78466_1_;
this.field_175080_Q *= f13; 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; 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); 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_187432_a(0.0F, -1.0F, 0.0F);
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.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_); 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)) if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q))
{ {
float f1 = 5.0F; float f1 = 5.0F;
@@ -1940,6 +1972,7 @@ @@ -1940,6 +1975,7 @@
GlStateManager.func_179102_b(f * 0.05F); GlStateManager.func_179102_b(f * 0.05F);
GlStateManager.func_179153_c(Math.min(f, 192.0F) * 0.5F); GlStateManager.func_179153_c(Math.min(f, 192.0F) * 0.5F);
} }