mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Cleaned up EnchantDisplay to work with eco 5.3.0
This commit is contained in:
parent
5af185d9e7
commit
2f3e210b64
@ -88,7 +88,22 @@ public class EnchantDisplay extends DisplayModule {
|
||||
|
||||
assert meta != null;
|
||||
|
||||
boolean hide = (boolean) args[0];
|
||||
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;
|
||||
|
||||
List<String> itemLore = null;
|
||||
|
||||
@ -219,35 +234,4 @@ 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};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user