1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-19 10:22:58 +01:00

Handle all our donor perks in one class.

This commit is contained in:
GJ
2013-02-18 11:41:44 -05:00
parent 671be42472
commit 083a89c1a3
13 changed files with 115 additions and 164 deletions

View File

@@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.utilities.PerksUtils;
import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.StringUtils;
@@ -124,26 +125,12 @@ public abstract class SkillCommand implements CommandExecutor {
protected String[] calculateLengthDisplayValues() {
int maxLength = skill.getAbility().getMaxTicks();
int length = 2 + (int) (skillValue / SkillTools.abilityLengthIncreaseLevel);
int enduranceLength = 0;
if (player.hasPermission("mcmmo.perks.activationtime.twelveseconds")) {
enduranceLength = length + 12;
}
else if (player.hasPermission("mcmmo.perks.activationtime.eightseconds")) {
enduranceLength = length + 8;
}
else if (player.hasPermission("mcmmo.perks.activationtime.fourseconds")) {
enduranceLength = length + 4;
}
int enduranceLength = PerksUtils.handleActivationPerks(player, length, maxLength);
if (maxLength != 0) {
if (length > maxLength) {
length = maxLength;
}
if (enduranceLength > maxLength) {
enduranceLength = maxLength;
}
}
return new String[] { String.valueOf(length), String.valueOf(enduranceLength) };