Added force option to hide fixer
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
# This may impact performance.
|
||||
force: false # If **all** items should have hide enchants removed - absolute last ditch effort, most likely to break other things.
|
||||
Reference in New Issue
Block a user