From 198b7e3f462a2277bf83230d500b902298a9b658 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 25 Feb 2019 17:02:29 -0800 Subject: [PATCH] xpratemultiplier fix --- src/main/java/com/gmail/nossr50/commands/XprateCommand.java | 4 ++-- .../gmail/nossr50/config/experience/ExperienceConfig.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/XprateCommand.java b/src/main/java/com/gmail/nossr50/commands/XprateCommand.java index 9f76e736e..93746e97a 100644 --- a/src/main/java/com/gmail/nossr50/commands/XprateCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/XprateCommand.java @@ -50,7 +50,7 @@ public class XprateCommand implements TabExecutor { mcMMO.p.toggleXpEventEnabled(); } - ExperienceConfig.getInstance().setExperienceGainsGlobalMultiplier(ORIGINAL_XP_RATE); + ExperienceConfig.getInstance().setGlobalXPMultiplier(ORIGINAL_XP_RATE); return true; case 2: @@ -81,7 +81,7 @@ public class XprateCommand implements TabExecutor { return true; } - ExperienceConfig.getInstance().setExperienceGainsGlobalMultiplier(newXpRate); + ExperienceConfig.getInstance().setGlobalXPMultiplier(newXpRate); if (mcMMO.p.isXPEventEnabled()) { if(AdvancedConfig.getInstance().useTitlesForXPEvent()) diff --git a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java index cac3995ac..45f2ab136 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -253,6 +253,11 @@ public class ExperienceConfig extends ConfigValidated { return getDoubleValue(EXPERIENCE_FORMULA, MULTIPLIER, GLOBAL); } + public void setGlobalXPMultiplier(double newXpMultiplier) + { + getUserRootNode().getNode(EXPERIENCE_FORMULA, MULTIPLIER, GLOBAL).setValue(newXpMultiplier); + } + //TODO: Rewrite this /*public void setExperienceGainsGlobalMultiplier(double value) { config.set(EXPERIENCE_FORMULA, MULTIPLIER, GLOBAL, value);