mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Prevent EntityPlayer.attackEntityFrom from firing LivingAttackEvent twice (#4661)
This commit is contained in:
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));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user