From a6113d37e1673c44697652c25cfd12d343724847 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 21 Jan 2023 15:55:00 +0000 Subject: [PATCH] Fix --- .../com/willfp/ecoenchants/display/EnchantDisplay.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantDisplay.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantDisplay.kt index 715c3c28..1f69871b 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantDisplay.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantDisplay.kt @@ -12,6 +12,7 @@ import com.willfp.ecoenchants.display.EnchantSorter.sortForDisplay import com.willfp.ecoenchants.enchants.EcoEnchant import com.willfp.ecoenchants.enchants.wrap import com.willfp.ecoenchants.target.EnchantmentTargets.isEnchantable +import com.willfp.libreforge.conditions.isMet import org.bukkit.Material import org.bukkit.entity.Player import org.bukkit.inventory.ItemFlag @@ -83,8 +84,10 @@ class EnchantDisplay(private val plugin: EcoEnchantsPlugin) : DisplayModule(plug showNotMet = true } - if (enchantLevel.conditions.any { it.notMetEffects.isNotEmpty() }) { - showNotMet = true + if (!showNotMet && !enchantLevel.conditions.isMet(player)) { // I know it's slow! I'll fix it. + if (enchantLevel.conditions.any { it.notMetEffects.isNotEmpty() }) { + showNotMet = true + } } }