mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-01 17:36:46 +01:00
Update AcrobaticsManager.java
Fixes a bug that prevents the player from receiving XP while having Resistance from a beacon.
This commit is contained in:
parent
c12d4319ac
commit
d6b3010b53
@ -151,7 +151,21 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isFatal(double damage) {
|
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) {
|
private float calculateRollXP(double damage, boolean isRoll) {
|
||||||
|
Loading…
Reference in New Issue
Block a user