mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 08:36:45 +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) {
|
private boolean isFatal(double damage) {
|
||||||
Player player = getPlayer();
|
|
||||||
int discount=1;
|
int discount=1;
|
||||||
// If the player has resistance active, carry resistance checking
|
// If the player has resistance active, carry resistance checking
|
||||||
if(player.hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)){
|
if(getPlayer().hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)){
|
||||||
Iterator potions=t.getActivePotionEffects().iterator();
|
Iterator potions=getPlayer().getActivePotionEffects().iterator();
|
||||||
while(potions.hasNext()){
|
while(potions.hasNext()){
|
||||||
PotionEffect potion=(PotionEffect)potions.next();
|
PotionEffect potion=(PotionEffect)potions.next();
|
||||||
if(potion.getType()==PotionEffectType.DAMAGE_RESISANCE)
|
if(potion.getType()==PotionEffectType.DAMAGE_RESISANCE)
|
||||||
{//Having resistance allows you to recieve less damage
|
{//Having resistance allows you to recieve less damage
|
||||||
int coupon=potion.getAmplifier();
|
int coupon=potion.getAmplifier();
|
||||||
discount=Math.min(0,1-(coupon*0.2));
|
discount=Math.min(0,1-(coupon*0.2));
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}//...Which is accounted here
|
}//...Which is accounted here
|
||||||
|
Loading…
Reference in New Issue
Block a user