mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +01:00
Resistance Discounting
Fix a variable name, and added a continue statement for efficiency
This commit is contained in:
parent
d6b3010b53
commit
5fbb7e7d4e
@ -151,17 +151,17 @@ public class AcrobaticsManager extends SkillManager {
|
||||
}
|
||||
|
||||
private boolean isFatal(double damage) {
|
||||
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();
|
||||
if(getPlayer().hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)){
|
||||
Iterator potions=getPlayer().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));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}//...Which is accounted here
|
||||
|
Loading…
Reference in New Issue
Block a user