From ebf489be8c236eb2c4edde85284373a2274809c7 Mon Sep 17 00:00:00 2001 From: Wyn Price Date: Tue, 22 Oct 2019 20:08:06 +0100 Subject: [PATCH] Fix shouldCauseReequipAnimation not affecting anything (#6256) --- .../client/renderer/FirstPersonRenderer.java.patch | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/patches/minecraft/net/minecraft/client/renderer/FirstPersonRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/FirstPersonRenderer.java.patch index 448a76ad8..a7515be5b 100644 --- a/patches/minecraft/net/minecraft/client/renderer/FirstPersonRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/FirstPersonRenderer.java.patch @@ -97,10 +97,12 @@ GlStateManager.popMatrix(); GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableBlend(); -@@ -600,6 +608,15 @@ +@@ -600,8 +608,17 @@ this.field_187471_h = MathHelper.func_76131_a(this.field_187471_h - 0.4F, 0.0F, 1.0F); } else { float f = clientplayerentity.func_184825_o(1.0F); +- this.field_187469_f += MathHelper.func_76131_a((Objects.equals(this.field_187467_d, itemstack) ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F); +- this.field_187471_h += MathHelper.func_76131_a((float)(Objects.equals(this.field_187468_e, itemstack1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F); + + boolean requipM = net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187467_d, itemstack, clientplayerentity.field_71071_by.field_70461_c); + boolean requipO = net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187468_e, itemstack1, -1); @@ -110,6 +112,8 @@ + if (!requipO && !Objects.equals(this.field_187468_e, itemstack1)) + this.field_187468_e = itemstack1; + - this.field_187469_f += MathHelper.func_76131_a((Objects.equals(this.field_187467_d, itemstack) ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F); - this.field_187471_h += MathHelper.func_76131_a((float)(Objects.equals(this.field_187468_e, itemstack1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F); ++ this.field_187469_f += MathHelper.func_76131_a((!requipM ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F); ++ this.field_187471_h += MathHelper.func_76131_a((float)(!requipO ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F); } + + if (this.field_187469_f < 0.1F) {