From e27d29913287d1f91efa7538d0aa16ecce874108 Mon Sep 17 00:00:00 2001 From: Shrek5InTheatres2019 Date: Thu, 29 Aug 2019 23:16:26 -0700 Subject: [PATCH] removing unnecessary code --- .../com/gmail/nossr50/datatypes/player/PlayerProfile.java | 4 +--- .../java/com/gmail/nossr50/util/commands/CommandUtils.java | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java index 4d1a4cf53..a9582c095 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java @@ -417,9 +417,7 @@ public class PlayerProfile { public int getXpToLevel(PrimarySkillType primarySkillType) { int level = (ExperienceConfig.getInstance().getCumulativeCurveEnabled()) ? UserManager.getPlayer(playerName).getPowerLevel() : skills.get(primarySkillType); FormulaType formulaType = ExperienceConfig.getInstance().getFormulaType(); - if (level == Config.getInstance().getLevelCap(primarySkillType)){ - return -1; - } + return mcMMO.getFormulaManager().getXPtoNextLevel(level, formulaType); } diff --git a/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java b/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java index f67ec6219..1ba0448a3 100644 --- a/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java +++ b/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java @@ -208,7 +208,7 @@ public final class CommandUtils { if (skill.isChildSkill()) { return LocaleLoader.getString("Skills.ChildStats", LocaleLoader.getString(StringUtils.getCapitalized(skill.toString()) + ".Listener") + " ", profile.getSkillLevel(skill)); } - if (profile.getXpToLevel(skill) == -1){ + if (profile.getSkillLevel(skill) == Config.getInstance().getLevelCap(skill)){ return LocaleLoader.getString("Skills.Stats", LocaleLoader.getString(StringUtils.getCapitalized(skill.toString()) + ".Listener") + " ", profile.getSkillLevel(skill), profile.getSkillXpLevel(skill), LocaleLoader.getString("Skills.MaxXP")); } return LocaleLoader.getString("Skills.Stats", LocaleLoader.getString(StringUtils.getCapitalized(skill.toString()) + ".Listener") + " ", profile.getSkillLevel(skill), profile.getSkillXpLevel(skill), profile.getXpToLevel(skill));