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 d50f45b0..67f43721 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 @@ -242,6 +242,10 @@ public class EnchantDisplay extends DisplayModule { 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; } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DisplayOptions.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DisplayOptions.java index d8ce2d58..6a1f4374 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DisplayOptions.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DisplayOptions.java @@ -79,6 +79,12 @@ public class DisplayOptions extends PluginDependent { @Getter private boolean usingAggressiveExperimentalHideFixer = false; + /** + * If all items should have hide enchants removed. + */ + @Getter + private boolean usingForceHideFixer = false; + /** * Instantiate new display options. * @@ -116,6 +122,7 @@ public class DisplayOptions extends PluginDependent { usingAggressiveLoreGetter = this.getPlugin().getConfigYml().getBool("advanced.lore-getter.aggressive"); usingExperimentalHideFixer = this.getPlugin().getConfigYml().getBool("advanced.hide-fixer.enabled"); usingAggressiveExperimentalHideFixer = this.getPlugin().getConfigYml().getBool("advanced.hide-fixer.aggressive"); + usingForceHideFixer = this.getPlugin().getConfigYml().getBool("advanced.hide-fixer.force"); boolean byType = this.getPlugin().getConfigYml().getBool("lore.sort-by-type"); boolean byLength = this.getPlugin().getConfigYml().getBool("lore.sort-by-length"); diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/ItemConversions.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/ItemConversions.java index 2fea5554..af991ed3 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/ItemConversions.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/ItemConversions.java @@ -214,8 +214,13 @@ public class ItemConversions extends PluginDependent implements Listener { return; } - if (meta.hasItemFlag(ItemFlag.HIDE_ENCHANTS) && meta.hasItemFlag(ItemFlag.HIDE_POTION_EFFECTS)) { - meta.removeItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_POTION_EFFECTS); + if (((EnchantDisplay) this.getPlugin().getDisplayModule()).getOptions().isUsingForceHideFixer()) { + meta.removeItemFlags(ItemFlag.HIDE_ENCHANTS); + meta.removeItemFlags(ItemFlag.HIDE_POTION_EFFECTS); + } else { + if (meta.hasItemFlag(ItemFlag.HIDE_ENCHANTS) && meta.hasItemFlag(ItemFlag.HIDE_POTION_EFFECTS)) { + meta.removeItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_POTION_EFFECTS); + } } itemStack.setItemMeta(meta); diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index f85461f8..39ee5602 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -30,6 +30,8 @@ lore: sort-by-rarity: false # Sort enchantments by rarity. # Any combination of the above options is valid + require-target: true # Only display items included in target.yml + type-ordering: # Only used if sort-by-type is enabled - top to bottom - normal - special @@ -123,4 +125,5 @@ advanced: enabled: false aggressive: false # Aggressive mode converts all items in all inventories whenever revealed. - # This may impact performance. \ No newline at end of file + # This may impact performance. + force: false # If **all** items should have hide enchants removed - absolute last ditch effort, most likely to break other things. \ No newline at end of file