mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-02 20:45:28 +02:00
Wire up XP bar settings
This commit is contained in:
@@ -111,58 +111,6 @@ public class ExperienceConfig extends ConfigValidated {
|
||||
return reason;
|
||||
}
|
||||
|
||||
/*
|
||||
* Experience Bar Stuff
|
||||
*/
|
||||
|
||||
public boolean isPartyExperienceBarsEnabled() {
|
||||
return getBooleanValue(EXPERIENCE + BARS, UPDATE, PARTY);
|
||||
}
|
||||
|
||||
public boolean isPassiveGainsExperienceBarsEnabled() {
|
||||
return getBooleanValue(EXPERIENCE + BARS, UPDATE, PASSIVE);
|
||||
}
|
||||
|
||||
public boolean getDoExperienceBarsAlwaysUpdateTitle() {
|
||||
return getBooleanValue(EXPERIENCE + BARS, THIS_MAY_CAUSE_LAG, ALWAYS + UPDATE + TITLES_WHEN_XPIS_GAINED, ENABLE) || getAddExtraDetails();
|
||||
}
|
||||
|
||||
public boolean getAddExtraDetails() {
|
||||
return getBooleanValue(EXPERIENCE + BARS, THIS_MAY_CAUSE_LAG, ALWAYS + UPDATE + TITLES_WHEN_XPIS_GAINED, EXTRA_DETAILS);
|
||||
}
|
||||
|
||||
public boolean isExperienceBarsEnabled() {
|
||||
return getBooleanValue(EXPERIENCE + BARS, ENABLE);
|
||||
}
|
||||
|
||||
public boolean isExperienceBarEnabled(PrimarySkillType primarySkillType) {
|
||||
return getBooleanValue(EXPERIENCE + BARS, StringUtils.getCapitalized(primarySkillType.toString()), ENABLE);
|
||||
}
|
||||
|
||||
public BarColor getExperienceBarColor(PrimarySkillType primarySkillType) {
|
||||
String colorValueFromConfig = getStringValue(EXPERIENCE + BARS, StringUtils.getCapitalized(primarySkillType.toString()), COLOR);
|
||||
|
||||
for (BarColor barColor : BarColor.values()) {
|
||||
if (barColor.toString().equalsIgnoreCase(colorValueFromConfig))
|
||||
return barColor;
|
||||
}
|
||||
|
||||
//In case the value is invalid
|
||||
return BarColor.WHITE;
|
||||
}
|
||||
|
||||
public BarStyle getExperienceBarStyle(PrimarySkillType primarySkillType) {
|
||||
String colorValueFromConfig = getStringValue(EXPERIENCE + BARS, StringUtils.getCapitalized(primarySkillType.toString()), BAR_STYLE);
|
||||
|
||||
for (BarStyle barStyle : BarStyle.values()) {
|
||||
if (barStyle.toString().equalsIgnoreCase(colorValueFromConfig))
|
||||
return barStyle;
|
||||
}
|
||||
|
||||
//In case the value is invalid
|
||||
return BarStyle.SOLID;
|
||||
}
|
||||
|
||||
/* Repair */
|
||||
public double getRepairXPBase() {
|
||||
return getDoubleValue(EXPERIENCE, REPAIR, BASE1);
|
||||
|
@@ -125,6 +125,27 @@ public class ConfigExperienceBars {
|
||||
return enableXPBars;
|
||||
}
|
||||
|
||||
public boolean getXPBarToggle(PrimarySkillType primarySkillType) {
|
||||
if(xpBarSpecificToggles.get(primarySkillType) == null)
|
||||
return true;
|
||||
|
||||
return xpBarSpecificToggles.get(primarySkillType);
|
||||
}
|
||||
|
||||
public BarColor getXPBarColor(PrimarySkillType primarySkillType) {
|
||||
if(xpBarColorMap.get(primarySkillType) == null)
|
||||
return BarColor.WHITE;
|
||||
|
||||
return xpBarColorMap.get(primarySkillType);
|
||||
}
|
||||
|
||||
public BarStyle getXPBarStyle(PrimarySkillType primarySkillType) {
|
||||
if(xpBarStyleMap.get(primarySkillType) == null)
|
||||
return BarStyle.SEGMENTED_6;
|
||||
|
||||
return xpBarStyleMap.get(primarySkillType);
|
||||
}
|
||||
|
||||
public HashMap<PrimarySkillType, Boolean> getXpBarSpecificToggles() {
|
||||
return xpBarSpecificToggles;
|
||||
}
|
||||
|
@@ -42,6 +42,14 @@ public class ConfigLeveling {
|
||||
* GETTER BOILERPLATE
|
||||
*/
|
||||
|
||||
public BarColor getXPBarColor(PrimarySkillType primarySkillType) {
|
||||
return configExperienceBars.getXPBarColor(primarySkillType);
|
||||
}
|
||||
|
||||
public BarStyle getXPBarStyle(PrimarySkillType primarySkillType) {
|
||||
return configExperienceBars.getXPBarStyle(primarySkillType);
|
||||
}
|
||||
|
||||
public boolean isPartyExperienceTriggerXpBarDisplay() {
|
||||
return configExperienceBars.isPartyExperienceTriggerXpBarDisplay();
|
||||
}
|
||||
@@ -70,6 +78,10 @@ public class ConfigLeveling {
|
||||
return configExperienceBars.getXpBarStyleMap();
|
||||
}
|
||||
|
||||
public boolean getXPBarToggle(PrimarySkillType primarySkillType) {
|
||||
return configExperienceBars.getXPBarToggle(primarySkillType);
|
||||
}
|
||||
|
||||
public ConfigExperienceBars getConfigExperienceBars() {
|
||||
return configExperienceBars;
|
||||
}
|
||||
|
Reference in New Issue
Block a user