Skip to content

Commit

Permalink
Fix issue with skill and stat levels not being detected properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Staartvin committed Jan 24, 2021
1 parent 9fad76c commit b47564e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.archyx.aureliumskills.stats.Stat;
import me.staartvin.utils.pluginlibrary.autorank.Library;

import java.util.Locale;
import java.util.UUID;

/**
Expand Down Expand Up @@ -48,7 +49,7 @@ public double getStatLevel(UUID uuid, String statType) {
Stat stat = null;

try {
stat = Stat.valueOf(statType);
stat = Stat.valueOf(statType.toUpperCase(Locale.ROOT));
} catch (Exception e) {
return 0;
}
Expand All @@ -68,11 +69,12 @@ public int getSkillLevel(UUID uuid, String skillName) {
Skill skill = null;

try {
skill = Skill.valueOf(skillName);
skill = Skill.valueOf(skillName.toUpperCase(Locale.ROOT));
} catch (Exception e) {
return 0;
}


return AureliumAPI.getSkillLevel(uuid, skill);
}

Expand All @@ -87,7 +89,7 @@ public double getXP(UUID uuid, String skillName) {
Skill skill = null;

try {
skill = Skill.valueOf(skillName);
skill = Skill.valueOf(skillName.toUpperCase(Locale.ROOT));
} catch (Exception e) {
return 0;
}
Expand Down

0 comments on commit b47564e

Please sign in to comment.