mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-18 16:35:25 +01:00
new config system pt 2
This commit is contained in:
parent
9a91daf910
commit
9a65621f68
@ -18,6 +18,7 @@ public class McmmoCore {
|
||||
private static EventCommander eventCommander;
|
||||
private static Logger logger;
|
||||
private static Platform platform;
|
||||
private static boolean retroModeEnabled;
|
||||
|
||||
//Why do all these things need to be here? Sigh...
|
||||
private static DatabaseManager databaseManager;
|
||||
@ -61,4 +62,6 @@ public class McmmoCore {
|
||||
public static UpgradeManager getUpgradeManager() { return upgradeManager; }
|
||||
|
||||
public static FormulaManager getFormulaManager() { return formulaManager; }
|
||||
|
||||
public static boolean isRetroModeEnabled() { return retroModeEnabled; }
|
||||
}
|
||||
|
@ -436,7 +436,7 @@ public class AdvancedConfig extends ConfigurableLoader {
|
||||
* @return the level at which abilities stop increasing in length
|
||||
*/
|
||||
public int getAbilityLengthCap() {
|
||||
if(!mcMMO.isRetroModeEnabled())
|
||||
if(!McmmoCore.isRetroModeEnabled())
|
||||
return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, STANDARD, CAP_LEVEL);
|
||||
else
|
||||
return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, RETRO_MODE, CAP_LEVEL);
|
||||
@ -448,7 +448,7 @@ public class AdvancedConfig extends ConfigurableLoader {
|
||||
* @return the number of levels required per ability length increase
|
||||
*/
|
||||
public int getAbilityLength() {
|
||||
if(!mcMMO.isRetroModeEnabled())
|
||||
if(!McmmoCore.isRetroModeEnabled())
|
||||
return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, STANDARD, INCREASE_LEVEL);
|
||||
else
|
||||
return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, RETRO_MODE, INCREASE_LEVEL);
|
||||
@ -464,10 +464,10 @@ public class AdvancedConfig extends ConfigurableLoader {
|
||||
* @return the level at which this skills max benefits will be reached on the curve
|
||||
*/
|
||||
public int getMaxBonusLevel(SubSkillType subSkillType) {
|
||||
if(!mcMMO.isRetroModeEnabled())
|
||||
|
||||
String[] keyPath = {subSkillType.getAdvConfigAddress(), MAX_BONUS_LEVEL};
|
||||
return mcMMO.isRetroModeEnabled() ? getIntValue(keyPath+ RETRO_MODE) : getIntValue(keyPath+ STANDARD);
|
||||
if(!McmmoCore.isRetroModeEnabled())
|
||||
return getIntValue(subSkillType.getAdvConfigAddress(), MAX_BONUS_LEVEL, STANDARD);
|
||||
else
|
||||
return getIntValue(subSkillType.getAdvConfigAddress(), MAX_BONUS_LEVEL, RETRO_MODE);
|
||||
}
|
||||
|
||||
public int getMaxBonusLevel(AbstractSubSkill abstractSubSkill) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.core.skills;
|
||||
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.StringUtils;
|
||||
|
||||
public enum SubSkillType {
|
||||
/* !! Warning -- Do not let subskills share a name with any existing PrimarySkillType as it will clash with the static import !! */
|
||||
@ -136,8 +136,8 @@ public enum SubSkillType {
|
||||
*
|
||||
* @return the root address for this skill in advanced.yml
|
||||
*/
|
||||
public String getAdvConfigAddress() {
|
||||
return "Skills." + StringUtils.getCapitalized(getParentSkill().toString()) + "." + getConfigName(toString());
|
||||
public String[] getAdvConfigAddress() {
|
||||
return new String[] {"Skills", StringUtils.getCapitalized(getParentSkill().toString()), getConfigName(toString())};
|
||||
}
|
||||
|
||||
/**
|
||||
@ -146,7 +146,7 @@ public enum SubSkillType {
|
||||
* @return the root address for this skill in rankskills.yml
|
||||
*/
|
||||
public String getRankConfigAddress() {
|
||||
return StringUtils.getCapitalized(getParentSkill().toString()) + "." + getConfigName(toString());
|
||||
//return StringUtils.getCapitalized(getParentSkill().toString()) + "." + getConfigName(toString());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user