SkillUtils cleanup, EventUtils creation

Move some functions in SkillUtils to more relevant locations.

Begin work on utility class to handle all event calls.
This commit is contained in:
GJ
2013-10-15 13:03:33 -04:00
parent 309dfd50cd
commit 468fbdab56
32 changed files with 409 additions and 504 deletions

View File

@ -10,7 +10,6 @@ import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.skills.SkillUtils;
public class McrankCommandDisplayTask extends BukkitRunnable {
private final Map<String, Integer> skills;
@ -31,13 +30,13 @@ public class McrankCommandDisplayTask extends BukkitRunnable {
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading"));
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Player", playerName));
for (SkillType skill : SkillType.nonChildSkills()) {
for (SkillType skill : SkillType.NON_CHILD_SKILLS) {
if (player != null && !Permissions.skillEnabled(player, skill)) {
continue;
}
rank = skills.get(skill.name());
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skill), (rank == null ? LocaleLoader.getString("Commands.mcrank.Unranked") : rank)));
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", skill.getSkillName(), (rank == null ? LocaleLoader.getString("Commands.mcrank.Unranked") : rank)));
}
rank = skills.get("ALL");

View File

@ -52,7 +52,7 @@ public class FormulaConversionTask extends BukkitRunnable {
private void editValues(PlayerProfile profile) {
mcMMO.p.debug("========================================================================");
mcMMO.p.debug("Conversion report for " + profile.getPlayerName() + ":");
for (SkillType skillType : SkillType.nonChildSkills()) {
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
int oldLevel = profile.getSkillLevel(skillType);
int oldXPLevel = profile.getSkillXpLevel(skillType);
int totalOldXP = mcMMO.getFormulaManager().calculateTotalExperience(oldLevel, oldXPLevel);