Fixed disabled enchantments

This commit is contained in:
Auxilor 2020-10-18 11:11:30 +01:00
parent e80cd0ae10
commit b0fc51ab92
2 changed files with 8 additions and 3 deletions

View File

@ -54,7 +54,12 @@ public final class CommandEnchantinfo extends AbstractCommand {
Set<Enchantment> conflicts = enchantment.getConflicts();
conflicts.removeIf(enchant -> (EcoEnchants.getFromEnchantment(enchant) != null) && !EcoEnchants.getFromEnchantment(enchantment).isEnabled());
new HashSet<>(conflicts).forEach(enchantment1 -> {
if(EcoEnchants.getFromEnchantment(enchantment1) != null) {
if(!EcoEnchants.getFromEnchantment(enchantment1).isEnabled())
conflicts.remove(enchantment1);
}
});
conflicts.forEach((enchantment1 -> {
if(EcoEnchants.getFromEnchantment(enchantment1) != null) {
@ -101,7 +106,7 @@ public final class CommandEnchantinfo extends AbstractCommand {
String maxLevel = String.valueOf(enchantment.getMaxLevel());
final String finalName = EnchantDisplay.CACHE.get(enchantment).getKey();
final String finalDescription = String.join("\n", EnchantDisplay.CACHE.get(enchantment).getValue());
final String finalDescription = "§f" + String.join(" ", EnchantDisplay.CACHE.get(enchantment).getValue()).replaceAll("\n","").replaceAll(EnchantDisplay.descriptionColor, "");
final String finalTargets = allTargets;
final String finalConflicts = allConflicts;
final String finalMaxLevel = maxLevel;

View File

@ -55,7 +55,7 @@ public final class EnchantDisplay {
private static String curseColor;
private static String specialColor;
private static String artifactColor;
private static String descriptionColor;
public static String descriptionColor;
private static int numbersThreshold;
private static boolean useNumerals;