From 673becb3e7bb49627d83ebf2c3db9b1d006d22ee Mon Sep 17 00:00:00 2001 From: Auxilor Date: Wed, 4 Aug 2021 18:35:47 +0100 Subject: [PATCH] Fixed bug --- .../com/willfp/ecoenchants/display/EnchantmentCache.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 6082d596..473b0ed8 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 @@ -145,13 +145,12 @@ public class EnchantmentCache { description.replaceAll(line -> Display.PREFIX + PLUGIN.getDisplayModule().getOptions().getDescriptionOptions().getColor() + line); - Map> levelDescription = new HashMap<>(); if (enchantment instanceof EcoEnchant ecoEnchant) { for (int i = 1; i <= ecoEnchant.getMaxLevel(); i++) { List levelDesc = new ArrayList<>(); - for (String s : ecoEnchant.getWrappedDescription()) { + for (String s : description) { levelDesc.add(s.replace("%value%", ecoEnchant.getPlaceholder(i))); } @@ -169,7 +168,6 @@ public class EnchantmentCache { } @ToString - @SuppressWarnings("DeprecatedIsStillUsed") public static final class CacheEntry { /** * The enchantment that this cache is for. @@ -250,7 +248,9 @@ public class EnchantmentCache { if (description == null) { if (enchantment instanceof EcoEnchant enchant) { List levelDesc = new ArrayList<>(); - for (String s : enchant.getWrappedDescription()) { + List defDesc = enchant.getWrappedDescription(); + defDesc.replaceAll(line -> Display.PREFIX + PLUGIN.getDisplayModule().getOptions().getDescriptionOptions().getColor() + line); + for (String s : defDesc) { levelDesc.add(s.replace("%value%", enchant.getPlaceholder(level))); }