From 7cf40d9dbf912619c2f2c319d7eb6de7c26cb913 Mon Sep 17 00:00:00 2001 From: Shrek5InTheatres2019 Date: Thu, 29 Aug 2019 18:51:48 -0700 Subject: [PATCH] Implementing request from issue #3918 --- .../com/gmail/nossr50/datatypes/player/PlayerProfile.java | 4 +++- .../java/com/gmail/nossr50/util/commands/CommandUtils.java | 4 +++- src/main/resources/locale/locale_en_US.properties | 1 + 3 files changed, 7 insertions(+), 2 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 a9582c095..4d1a4cf53 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java @@ -417,7 +417,9 @@ 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 e48adeafd..f67ec6219 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,9 @@ 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){ + 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)); } diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index a969d35c8..1c76da967 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -982,6 +982,7 @@ Skills.NeedMore.Extra=[[DARK_RED]]You need more [[GRAY]]{0}{1} Skills.Parents= PARENTS Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]]) Skills.ChildStats={0}[[GREEN]]{1} +Skills.MaxXP=Max Skills.TooTired=You are too tired to use that ability again. [[YELLOW]]({0}s) Skills.Cancelled=[[GOLD]]{0} [[RED]]cancelled! Skills.ConfirmOrCancel=[[GREEN]]Right-click again to confirm [[GOLD]]{0}[[GREEN]]. Left-click to cancel.