Child Skills will not trigger XP bars (for now)

This commit is contained in:
nossr50 2019-01-18 17:21:05 -08:00
parent e74bc9fd95
commit df8f050cf1
5 changed files with 18 additions and 6 deletions

View File

@ -252,11 +252,12 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
*/
public boolean getDoExperienceBarsAlwaysUpdateTitle()
{
return config.getBoolean("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained", false);
return config.getBoolean("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.Enable", false);
}
public boolean isExperienceBarsEnabled() { return config.getBoolean("Experience_Bars.Enable"); }
public boolean isExperienceBarEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Experience_Bars."+StringUtils.getCapitalized(primarySkillType.toString())+".Enable");}
public boolean getAddExtraDetails() { return config.getBoolean("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.ExtraDetails", false);}
public boolean isExperienceBarsEnabled() { return config.getBoolean("Experience_Bars.Enable", true); }
public boolean isExperienceBarEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Experience_Bars."+StringUtils.getCapitalized(primarySkillType.toString())+".Enable", true);}
public BarColor getExperienceBarColor(PrimarySkillType primarySkillType)
{

View File

@ -149,8 +149,8 @@ public class McMMOPlayer {
public void updateXPBar(PrimarySkillType primarySkillType, mcMMO plugin)
{
/*if(experienceBarManager == null)
experienceBarManager = new ExperienceBarManager(this);*/
if(primarySkillType.isChildSkill())
return;
experienceBarManager.updateExperienceBar(primarySkillType, plugin);
}

View File

@ -55,6 +55,10 @@ public class ExperienceBarWrapper {
}
private String getTitleTemplate() {
//If they are using extra details
if(ExperienceConfig.getInstance().getAddExtraDetails())
return LocaleLoader.getString("XPBar.Complex.Template", LocaleLoader.getString("XPBar."+niceSkillName, getLevel()), getCurrentXP(), getMaxXP(), getPowerLevel(), getPercentageOfLevel());
return LocaleLoader.getString("XPBar."+niceSkillName, getLevel(), getCurrentXP(), getMaxXP(), getPowerLevel(), getPercentageOfLevel());
}

View File

@ -28,7 +28,12 @@ Experience_Bars:
# If you want to use a fancy edited title from the locale, then you'll probably want to turn this on, but it will make your server do a lot more work!
# I recommend leaving this off!
ThisMayCauseLag:
AlwaysUpdateTitlesWhenXPIsGained: false
ExtraDetails:
Enable: false
AlwaysUpdateTitlesWhenXPIsGained:
Enable: false
# You can make your own custom details in the locale file without having to use the ExtraDetails setting!
ExtraDetails: true
Acrobatics:
Enable: true
Color: PINK

View File

@ -94,6 +94,8 @@ XPBar.Swords=Swords Lv.[[GOLD]]{0}
XPBar.Taming=Taming Lv.[[GOLD]]{0}
XPBar.Unarmed=Unarmed Lv.[[GOLD]]{0}
XPBar.Woodcutting=Woodcutting Lv.[[GOLD]]{0}
#This is just a preset template that gets used if the 'ExtraDetails' setting is turned on in experience.yml (off by default), you can ignore this template and just edit the strings above
XPBar.Complex.Template={0} [[YELLOW]]([[GREEN]]{1}[[YELLOW]]/[[GREEN]]{2}[[YELLOW]])[[DARK_AQUA]] {4}[[WHITE]]% Power Lvl.[[RED]]{3}
# XP BAR Allows for the following variables -- {0} = Skill Level, {1} Current XP, {2} XP Needed for next level, {3} Power Level, {4} Percentage of Level
# Make sure you turn on Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained if you want the XP bar title to update every time a player gains XP!
# END STYLING