Prevent EntityPlayer.attackEntityFrom from firing LivingAttackEvent twice (#4661)

This commit is contained in:
coolsquid authored and LexManos committed 2018-04-01 01:12:46 -07:00
1 parent e099aa32d4
commit f5c0b894bf
5 files changed
+41 -3

No files matched your search

@@ -567,6 +567,11 @@ public class ForgeHooks
}
public static boolean onLivingAttack(EntityLivingBase entity, DamageSource src, float amount)
{
return entity instanceof EntityPlayer || !MinecraftForge.EVENT_BUS.post(new LivingAttackEvent(entity, src, amount));
}
public static boolean onPlayerAttack(EntityLivingBase entity, DamageSource src, float amount)
{
return !MinecraftForge.EVENT_BUS.post(new LivingAttackEvent(entity, src, amount));
}