Fixed bug where non-player arrows couldn't be deflected.

This commit is contained in:
GJ 2013-05-02 08:23:18 -04:00
parent 0574de4a29
commit b36096e54d
2 changed files with 19 additions and 0 deletions

View File

@ -31,6 +31,7 @@ Version 1.4.06-dev
= Fixed Fishing treasures always having the same enchants
= Fixed Smelting returning ink sacs instead of Lapis when double-dropping
= Fixed bug where players could remain in party chat after leaving or being kicked from a party.
= Fixed bug where non-player arrows couldn't be deflected.
! Changed Berserk to add items to inventory rather than denying pickup
! Changed Call of the Wild, newly summoned pet's will have a custom name. (added permission node to disable this)
! Changed Chimaera Wing's recipe result to use the ingredient Material

View File

@ -284,6 +284,24 @@ public final class CombatUtils {
swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage());
}
}
if (damager.getType() == EntityType.ARROW) {
LivingEntity shooter = ((Arrow) damager).getShooter();
if (shooter instanceof Player || !SkillType.UNARMED.getPVEEnabled()) {
return;
}
UnarmedManager unarmedManager = mcMMOPlayer.getUnarmedManager();
if (unarmedManager.canDeflect()) {
event.setCancelled(unarmedManager.deflectCheck());
if (event.isCancelled()) {
return;
}
}
}
}
else if (attacker instanceof Player) {
Player player = (Player) attacker;