From 2ed76f1051951eb557fb3a7ce5f642ca3c5c0936 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Wed, 29 Dec 2021 18:33:49 +0000 Subject: [PATCH] Added hide-in-lore flag --- .../java/com/willfp/ecoenchants/display/EnchantDisplay.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantDisplay.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantDisplay.java index ca516930..e7507ce0 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantDisplay.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantDisplay.java @@ -124,6 +124,10 @@ public class EnchantDisplay extends DisplayModule { enchantments.clear(); unsorted.forEach(enchantment -> enchantments.put(enchantment, tempEnchantments.get(enchantment))); enchantments.forEach((enchantment, level) -> { + if (enchantment instanceof EcoEnchant ecoEnchant && ecoEnchant.hasFlag("hide-in-lore")) { + return; + } + String name = player == null ? EnchantmentCache.getEntry(enchantment).getNameWithLevel(level) : EnchantmentCache.getEntry(enchantment).getNameWithLevel(level, player);