From f19b7d73f9a92674fcac5f46650852fe3dfc5b26 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 18 Oct 2020 19:06:10 +0100 Subject: [PATCH] Fixed /enchantinfo --- .../command/commands/CommandEnchantinfo.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEnchantinfo.java b/Plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEnchantinfo.java index 6f964228..12b8fa5c 100644 --- a/Plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEnchantinfo.java +++ b/Plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEnchantinfo.java @@ -105,8 +105,19 @@ public final class CommandEnchantinfo extends AbstractCommand { String maxLevel = String.valueOf(enchantment.getMaxLevel()); + StringBuilder descriptionBuilder = new StringBuilder(); + + EnchantDisplay.CACHE.get(enchantment).getValue().forEach(s -> { + descriptionBuilder.append(s); + descriptionBuilder.append(" "); + }); + + String description = descriptionBuilder.toString(); + description = description.replaceAll("§w", ""); + description = description.replaceAll(EnchantDisplay.descriptionColor, ""); + final String finalName = EnchantDisplay.CACHE.get(enchantment).getKey(); - final String finalDescription = "§f" + String.join(" ", EnchantDisplay.CACHE.get(enchantment).getValue()).replaceAll("\n","").replaceAll(EnchantDisplay.descriptionColor, ""); + final String finalDescription = description; final String finalTargets = allTargets; final String finalConflicts = allConflicts; final String finalMaxLevel = maxLevel;