mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-23 05:41:19 +01:00
Removed legacy lore lines from before eco 4.0.0
This commit is contained in:
parent
0f029de0c8
commit
045e60715e
@ -192,6 +192,21 @@ public class EnchantDisplay extends DisplayModule {
|
||||
}
|
||||
|
||||
ItemMeta meta = itemStack.getItemMeta();
|
||||
List<String> itemLore;
|
||||
|
||||
if (meta.hasLore()) {
|
||||
itemLore = meta.getLore();
|
||||
} else {
|
||||
itemLore = new ArrayList<>();
|
||||
}
|
||||
|
||||
if (itemLore == null) {
|
||||
itemLore = new ArrayList<>();
|
||||
}
|
||||
|
||||
itemLore.removeIf(s -> s.startsWith("§w"));
|
||||
|
||||
meta.setLore(itemLore);
|
||||
|
||||
if (!meta.getPersistentDataContainer().has(keySkip, PersistentDataType.INTEGER)) {
|
||||
meta.removeItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
|
||||
@ -199,5 +214,9 @@ public class EnchantDisplay extends DisplayModule {
|
||||
}
|
||||
meta.getPersistentDataContainer().remove(keySkip);
|
||||
itemStack.setItemMeta(meta);
|
||||
|
||||
if (itemStack.getItemMeta() == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user