Add and wire up Early Game Boost settings

This commit is contained in:
nossr50
2019-05-07 00:09:31 -07:00
parent 8033bc577c
commit c968b9f94a
13 changed files with 52 additions and 26 deletions

View File

@@ -118,9 +118,6 @@ public class ExperienceConfig extends ConfigValidated {
return reason;
}
public boolean isEarlyGameBoostEnabled() { return config.getBoolean("EarlyGameBoost.Enabled", true); }
public double getEarlyGameBoostMultiplier() { return config.getDouble("EarlyGameBoost.MaxLevelMultiplier", 0.05D); }
/*
* FORMULA SETTINGS
*/

View File

@@ -0,0 +1,29 @@
package com.gmail.nossr50.config.hocon.playerleveling;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigLevelEarlyGameBoost {
public static final boolean EARLY_GAME_BOOST_DEFAULT = true;
public static final double BOOST_MULTIPLIER_DEFAULT = 0.05D;
@Setting(value = "Enabled", comment = "If set to true, the early game XP boost will be applied." +
"\nDefault value: "+EARLY_GAME_BOOST_DEFAULT)
private boolean enableEarlyGameBoost = EARLY_GAME_BOOST_DEFAULT;
@Setting(value = "Max-Level-Percentage", comment = "This value is multiplied by a skills level cap to see determine when to stop giving a boost." +
"\nLevels in mcMMO are not capped by default, so if the skill has no set level cap it will instead use the value 100 or 1000 (if in RetroMode)" +
"\nWith default settings, this will result in the first 5 levels (or 50 in Retro) being boosted" +
"\nDefault value: "+BOOST_MULTIPLIER_DEFAULT)
private double earlyGameBoostMultiplier = BOOST_MULTIPLIER_DEFAULT;
public double getEarlyGameBoostMultiplier() {
return earlyGameBoostMultiplier;
}
public boolean isEnableEarlyGameBoost() {
return enableEarlyGameBoost;
}
}

View File

@@ -20,6 +20,10 @@ public class ConfigLeveling {
@Setting(value = "General", comment = "Settings for player leveling that don't fall into other categories")
private ConfigSectionLevelingGeneral configSectionLevelingGeneral = new ConfigSectionLevelingGeneral();
@Setting(value = "Early-Game-Boost", comment = "mcMMO incorporates an early game XP boost to get players to the first abilities in each skill faster." +
"\nUsing default settings, players will reach level 5 (or 50 in RetroMode) much faster than they normally would.")
private ConfigLevelEarlyGameBoost earlyGameBoost = new ConfigLevelEarlyGameBoost();
@Setting(value = "Experience-Formula")
private ConfigExperienceFormula configExperienceFormula = new ConfigExperienceFormula();
@@ -27,6 +31,18 @@ public class ConfigLeveling {
* GETTER BOILERPLATE
*/
public double getEarlyGameBoostMultiplier() {
return earlyGameBoost.getEarlyGameBoostMultiplier();
}
public boolean isEnableEarlyGameBoost() {
return earlyGameBoost.isEnableEarlyGameBoost();
}
public ConfigLevelEarlyGameBoost getEarlyGameBoost() {
return earlyGameBoost;
}
public ConfigSectionLevelCaps getConfigSectionLevelCaps() {
return configSectionLevelCaps;
}