Supports durability for items with no lore

This commit is contained in:
Jules 2021-07-25 10:32:44 +02:00
parent f70c277462
commit b95896c4b7

View File

@ -36,13 +36,15 @@ public class LoreUpdate {
this.item = item;
this.old = old;
this.replace = replace;
// Quite impossible that an MMOItem has no lore
this.lore = item.getItemMeta().getLore();
}
public ItemStack updateLore() {
// Possible that the item has no lore
if (lore == null || lore.isEmpty())
return item;
for (int i = 0; i < lore.size(); i++) {
// Finds the old line in the old lore