Skip to content

Commit

Permalink
Merge pull request #12 from GTNewHorizons/fix/thorn-is-not-an-attack
Browse files Browse the repository at this point in the history
prevent onAttack from firing if damage is caused by reflection
  • Loading branch information
boubou19 authored Oct 16, 2022
2 parents acce825 + 86e3c90 commit e453eec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void onEntityLivingHurt(LivingHurtEvent event)
* and attacker
*/
Entity attacker = event.source.getEntity();
if (attacker != null && attacker instanceof EntityLivingBase)
if (attacker instanceof EntityLivingBase && !event.source.damageType.equals("thorns"))
{
mod = InfernalMobsCore.getMobModifiers((EntityLivingBase) attacker);
if (mod != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public float onHurt(EntityLivingBase mob, DamageSource source, float damage)
{
reflectedDamage = Math.min(maxReflectDamage, reflectedDamage);
}
source.getEntity().attackEntityFrom(DamageSource.causeMobDamage(mob), reflectedDamage);
source.getEntity().attackEntityFrom(DamageSource.causeThornsDamage(mob), reflectedDamage);
}

return super.onHurt(mob, source, damage);
Expand Down

0 comments on commit e453eec

Please sign in to comment.