mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 13:46:46 +01:00
Avoid calling the same thing 3 times.
This commit is contained in:
parent
271740d2ac
commit
8ad6337dde
@ -390,8 +390,10 @@ public class Skills {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ticks = 2 + (PP.getSkillLevel(type) / 50);
|
int ticks = 2 + (PP.getSkillLevel(type) / 50);
|
||||||
if (ability.getMaxTicks() != 0 && ticks > ability.getMaxTicks()) {
|
int maxTicks = ability.getMaxTicks();
|
||||||
ticks = ability.getMaxTicks();
|
|
||||||
|
if (maxTicks != 0 && ticks > maxTicks) {
|
||||||
|
ticks = maxTicks;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PP.getAbilityMode(ability) && cooldownOver(PP.getSkillDATS(ability), ability.getCooldown())) {
|
if (!PP.getAbilityMode(ability) && cooldownOver(PP.getSkillDATS(ability), ability.getCooldown())) {
|
||||||
@ -403,7 +405,7 @@ public class Skills {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PP.setSkillDATS(ability, System.currentTimeMillis()+(ticks * TIME_CONVERSION_FACTOR));
|
PP.setSkillDATS(ability, System.currentTimeMillis() + (ticks * TIME_CONVERSION_FACTOR));
|
||||||
PP.setAbilityMode(ability, true);
|
PP.setAbilityMode(ability, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user