Permalink
Browse files

Fixed bug where /addxp was setting instead of adding experience

Fixes #898
  • Loading branch information...
TfT-02 committed Mar 30, 2013
1 parent f62e053 commit fc8ad40b00fa24262bceffb0a803dcc6cb6ea131
View
@@ -9,6 +9,7 @@ Key:
Version 1.4.05-dev
+ Added option to allow refreshing of chunks after block-breaking abilities. (Disabled by default)
+ = Fixed bug where /addxp was setting instead of adding experience
Version 1.4.04
+ Added functions to ExperienceAPI for use with offline players
@@ -24,7 +24,7 @@ protected void handleCommand(SkillType skill) {
mcMMOPlayer.applyXpGain(skill, value);
}
else {
- profile.setSkillXpLevel(skill, value);
+ profile.addExperience(skill, value);
}
}
@@ -666,6 +666,20 @@ public void addLevels(SkillType skillType, int levels) {
skillsXp.put(skillType, 0);
}
+ /**
+ * Add Experience to a skill.
+ *
+ * @param skillType Type of skill to add experience to
+ * @param experience Number of experience to add
+ */
+ public void addExperience(SkillType skillType, int experience) {
+ if (skillType.isChildSkill()) {
+ return;
+ }
+
+ skillsXp.put(skillType, skillsXp.get(skillType) + experience);
+ }
+
/**
* Get the amount of Xp remaining before the next level.
*

0 comments on commit fc8ad40

Please sign in to comment.