More formatting changes

This commit is contained in:
Auxilor 2021-08-10 14:47:29 +01:00
parent cf47b0a480
commit 63bd87ff66
2 changed files with 10 additions and 9 deletions

View File

@ -258,22 +258,23 @@ public class EnchantmentCache {
numberString += level;
}
String appendedName = name + numberString;
if (level > enchantment.getMaxLevel() && PLUGIN.getDisplayModule().getOptions().getMaxLevelOptions().isReformatAboveMaxLevel()) {
String clone = rawName;
String color = PLUGIN.getDisplayModule().getOptions().getMaxLevelOptions().getAboveMaxLevelFormat();
if (color.contains("{}")) {
appendedName = color.replace("{}", appendedName);
clone = color.replace("{}", clone);
} else {
appendedName = color + appendedName;
clone = color + clone;
}
appendedName = StringUtils.format(appendedName);
return StringUtils.format(clone + numberString);
} else {
return name + numberString;
}
return appendedName;
} else {
return name;
}
return name;
}
/**

View File

@ -33,6 +33,6 @@ public class MaxLevelOptions extends PluginDependent<EcoPlugin> {
*/
public void update() {
reformatAboveMaxLevel = this.getPlugin().getConfigYml().getBool("lore.above-max-level.reformat");
aboveMaxLevelFormat = this.getPlugin().getLangYml().getString("above-max-level-color", false);
aboveMaxLevelFormat = this.getPlugin().getLangYml().getBukkitHandle().getString("above-max-level-color");
}
}