diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantmentCache.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantmentCache.java index d7647a0f..3a9a15c5 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantmentCache.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantmentCache.java @@ -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; } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/MaxLevelOptions.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/MaxLevelOptions.java index 794e98e4..b79c588c 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/MaxLevelOptions.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/MaxLevelOptions.java @@ -19,6 +19,12 @@ public class MaxLevelOptions extends PluginDependent { @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 { */ 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"); } } diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index 82b2b3c2..7df4e594 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -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