From 907cda168a6b0f2ddb21092ca209f0f08cca8fca Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 31 Jan 2021 16:19:24 +0000 Subject: [PATCH] Potential HidePotionEffects fix --- .../com/willfp/ecoenchants/display/EnchantDisplay.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 8c5e6063..3c1fd71b 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 @@ -89,9 +89,7 @@ public class EnchantDisplay { itemLore.removeIf(s -> s.startsWith(PREFIX)); if (!meta.getPersistentDataContainer().has(KEY_SKIP, PersistentDataType.INTEGER)) { - if (meta instanceof EnchantmentStorageMeta) { - meta.removeItemFlags(ItemFlag.HIDE_POTION_EFFECTS); // Thanks ShaneBee! - } + meta.removeItemFlags(ItemFlag.HIDE_POTION_EFFECTS); meta.removeItemFlags(ItemFlag.HIDE_ENCHANTS); } meta.getPersistentDataContainer().remove(KEY_SKIP); @@ -135,7 +133,9 @@ public class EnchantDisplay { if (hide || meta.getPersistentDataContainer().has(KEY_SKIP, PersistentDataType.INTEGER)) { meta.addItemFlags(ItemFlag.HIDE_ENCHANTS); - meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); + if (meta instanceof EnchantmentStorageMeta) { + meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); + } meta.getPersistentDataContainer().set(KEY_SKIP, PersistentDataType.INTEGER, 1); item.setItemMeta(meta); return item;