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 5fc084ac..c816c6bc 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 @@ -88,22 +88,7 @@ public class EnchantDisplay extends DisplayModule { assert meta != null; - boolean hideEnchants = false; - - if (meta.hasItemFlag(ItemFlag.HIDE_ENCHANTS) || meta.hasItemFlag(ItemFlag.HIDE_POTION_EFFECTS)) { - hideEnchants = true; - } - - if (meta.getPersistentDataContainer().has(legacyV, PersistentDataType.INTEGER) - || (options.isUsingExperimentalHideFixer() && options.isUsingForceHideFixer())) { - hideEnchants = false; - } - - if (options.isUsingExperimentalHideFixer() && meta.hasItemFlag(ItemFlag.HIDE_ENCHANTS) && meta.hasItemFlag(ItemFlag.HIDE_POTION_EFFECTS)) { - hideEnchants = false; - } - - boolean hide = hideEnchants; + boolean hide = (boolean) args[0]; List itemLore = null; @@ -234,4 +219,35 @@ public class EnchantDisplay extends DisplayModule { meta.getPersistentDataContainer().remove(keySkip); itemStack.setItemMeta(meta); } + + @Override + protected Object[] generateVarArgs(@NotNull final ItemStack itemStack) { + ItemMeta meta = itemStack.getItemMeta(); + if (meta == null) { + return new Object[]{false}; + } + boolean hideEnchants = false; + + if (meta.hasItemFlag(ItemFlag.HIDE_ENCHANTS) || meta.hasItemFlag(ItemFlag.HIDE_POTION_EFFECTS)) { + hideEnchants = true; + } + + if (meta.getPersistentDataContainer().has(legacyV, PersistentDataType.INTEGER)) { + hideEnchants = false; + } + + if (Display.isFinalized(itemStack)) { + hideEnchants = false; + } + + if (options.isUsingExperimentalHideFixer() && options.isUsingForceHideFixer()) { + hideEnchants = false; + } + + if (options.isUsingExperimentalHideFixer() && meta.hasItemFlag(ItemFlag.HIDE_ENCHANTS) && meta.hasItemFlag(ItemFlag.HIDE_POTION_EFFECTS)) { + hideEnchants = false; + } + + return new Object[]{hideEnchants}; + } }