Fix swap animations for sure this time.

This commit is contained in:
LexManos 2016-03-21 20:43:22 -07:00
parent 3ce53a7ee0
commit a4d5760539
2 changed files with 5 additions and 6 deletions

View File

@ -51,8 +51,8 @@
float f = entityplayersp.func_184825_o(1.0F);
- this.field_187469_f += MathHelper.func_76131_a((Objects.equal(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.equal(this.field_187468_e, itemstack1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F);
+ this.field_187469_f += MathHelper.func_76131_a((net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187467_d, itemstack, entityplayersp.field_71071_by.field_70461_c) ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F);
+ this.field_187471_h += MathHelper.func_76131_a((float)(net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187468_e, itemstack1, -1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F);
+ this.field_187469_f += MathHelper.func_76131_a((!net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187467_d, itemstack, entityplayersp.field_71071_by.field_70461_c) ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F);
+ this.field_187471_h += MathHelper.func_76131_a((float)(!net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187468_e, itemstack1, -1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F);
}
if (this.field_187469_f < 0.1F)

View File

@ -629,10 +629,9 @@ public class ForgeHooksClient
// FIXME
public static boolean shouldCauseReequipAnimation(ItemStack from, ItemStack to, int slot)
{
if(!Objects.equal(from, to) || from == null)
{
return Objects.equal(from, to);
}
if (from == null && to != null) return true;
if (from == null && to == null) return false;
if (from != null && to == null) return true;
boolean changed = false;
if (slot != -1)
{