mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Added numbers-only to above-max-level reformatting
This commit is contained in:
parent
1eac3022e4
commit
792684ecec
@ -260,15 +260,25 @@ public class EnchantmentCache {
|
||||
|
||||
if (level > enchantment.getMaxLevel() && PLUGIN.getDisplayModule().getOptions().getMaxLevelOptions().isReformatAboveMaxLevel()) {
|
||||
String clone = rawName;
|
||||
if (PLUGIN.getDisplayModule().getOptions().getMaxLevelOptions().isNumbersOnly()) {
|
||||
String color = PLUGIN.getDisplayModule().getOptions().getMaxLevelOptions().getAboveMaxLevelFormat();
|
||||
if (color.contains("{}")) {
|
||||
numberString = color.replace("{}", numberString);
|
||||
} else {
|
||||
numberString = color + numberString;
|
||||
}
|
||||
|
||||
String color = PLUGIN.getDisplayModule().getOptions().getMaxLevelOptions().getAboveMaxLevelFormat();
|
||||
if (color.contains("{}")) {
|
||||
clone = color.replace("{}", clone);
|
||||
return StringUtils.format(clone + numberString);
|
||||
} else {
|
||||
clone = color + clone;
|
||||
}
|
||||
String color = PLUGIN.getDisplayModule().getOptions().getMaxLevelOptions().getAboveMaxLevelFormat();
|
||||
if (color.contains("{}")) {
|
||||
clone = color.replace("{}", clone);
|
||||
} else {
|
||||
clone = color + clone;
|
||||
}
|
||||
|
||||
return StringUtils.format(clone + numberString);
|
||||
return StringUtils.format(clone + numberString);
|
||||
}
|
||||
} else {
|
||||
return name + numberString;
|
||||
}
|
||||
|
@ -19,6 +19,12 @@ public class MaxLevelOptions extends PluginDependent<EcoPlugin> {
|
||||
@Getter
|
||||
private String aboveMaxLevelFormat;
|
||||
|
||||
/**
|
||||
* If only the numbers should be formatted.
|
||||
*/
|
||||
@Getter
|
||||
private boolean numbersOnly;
|
||||
|
||||
/**
|
||||
* Create new description options.
|
||||
*
|
||||
@ -33,6 +39,7 @@ public class MaxLevelOptions extends PluginDependent<EcoPlugin> {
|
||||
*/
|
||||
public void update() {
|
||||
reformatAboveMaxLevel = this.getPlugin().getConfigYml().getBool("lore.above-max-level.reformat");
|
||||
numbersOnly = this.getPlugin().getConfigYml().getBool("lore.above-max-level.numbers-only");
|
||||
aboveMaxLevelFormat = this.getPlugin().getLangYml().getBukkitHandle().getString("above-max-level-color");
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ lore:
|
||||
# Format is available in lang.yml
|
||||
above-max-level:
|
||||
reformat: true
|
||||
numbers-only: # If only the numbers should be reformatted
|
||||
|
||||
|
||||
sort-by-type: false # Sort enchantments by type
|
||||
|
Loading…
Reference in New Issue
Block a user