Cleanup some XP functions, remove unused scoreboard values, minor refactoring.

This commit is contained in:
GJ
2013-10-29 09:49:41 -04:00
parent cc2c9eb21d
commit 3be443c63c
9 changed files with 116 additions and 146 deletions

View File

@ -582,18 +582,7 @@ public final class ExperienceAPI {
private static void addOfflineXP(String playerName, SkillType skill, int XP) {
PlayerProfile profile = getOfflineProfile(playerName);
if (skill.isChildSkill()) {
Set<SkillType> parentSkills = FamilyTree.getParents(skill);
for (SkillType parentSkill : parentSkills) {
profile.setSkillXpLevel(parentSkill, profile.getSkillLevel(parentSkill) + (XP / parentSkills.size()));
}
profile.save();
return;
}
profile.setSkillXpLevel(skill, profile.getSkillXpLevel(skill) + XP);
profile.addExperience(skill, XP);
profile.save();
}