mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 10:14:43 +02:00
Fixed bug where /addxp was setting instead of adding experience
Fixes #898
This commit is contained in:
@ -24,7 +24,7 @@ public class AddxpCommand extends ExperienceCommand {
|
||||
mcMMOPlayer.applyXpGain(skill, value);
|
||||
}
|
||||
else {
|
||||
profile.setSkillXpLevel(skill, value);
|
||||
profile.addExperience(skill, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -666,6 +666,20 @@ public class PlayerProfile {
|
||||
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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user