Update AcrobaticsManager.java

Fixes a bug that prevents the player from receiving XP while having Resistance from a beacon.
This commit is contained in:
Vincentyification 2014-01-02 13:21:20 +08:00
parent c12d4319ac
commit d6b3010b53

View File

@ -151,7 +151,21 @@ public class AcrobaticsManager extends SkillManager {
}
private boolean isFatal(double damage) {
return getPlayer().getHealth() - damage <= 0;
Player player = getPlayer();
int discount=1;
// If the player has resistance active, carry resistance checking
if(player.hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)){
Iterator potions=t.getActivePotionEffects().iterator();
while(potions.hasNext()){
PotionEffect potion=(PotionEffect)potions.next();
if(potion.getType()==PotionEffectType.DAMAGE_RESISANCE)
{//Having resistance allows you to recieve less damage
int coupon=potion.getAmplifier();
discount=Math.min(0,1-(coupon*0.2));
}
}
}//...Which is accounted here
return getPlayer().getHealth() - damage*discount <= 0;
}
private float calculateRollXP(double damage, boolean isRoll) {