Fixed player data save bug when hitting max class level

This commit is contained in:
Jules 2025-11-11 17:43:48 +01:00
parent c712f82bf2
commit 6286c3d201
2 changed files with 2 additions and 3 deletions

View File

@ -116,7 +116,6 @@ public class PlayerClass implements ExperienceObject, PreloadedObject {
expCurve = ExperienceCurve.fromConfig(config.getString("exp-curve"));
} catch (Throwable exception) {
MMOCore.log(Level.WARNING, "Could not load exp curve from class '" + id + "': " + exception.getMessage());
exception.printStackTrace();
}
this.expCurve = expCurve;

View File

@ -52,7 +52,7 @@ public class ListExperienceCurve implements ExperienceCurve {
@Override
public long getExperience(@NotNull PlayerData player, int level) {
Validate.isTrue(level > 0, "Level must be stricly positive");
return experience.get(Math.min(level, experience.size()));
Validate.isTrue(level > 0, "Level must be strictly positive");
return experience.get(Math.min(level, experience.size()) - 1);
}
}