mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-04-06 18:37:39 +02:00
Supports durability for items with no lore
This commit is contained in:
parent
f70c277462
commit
b95896c4b7
@ -36,13 +36,15 @@ public class LoreUpdate {
|
|||||||
this.item = item;
|
this.item = item;
|
||||||
this.old = old;
|
this.old = old;
|
||||||
this.replace = replace;
|
this.replace = replace;
|
||||||
|
|
||||||
// Quite impossible that an MMOItem has no lore
|
|
||||||
this.lore = item.getItemMeta().getLore();
|
this.lore = item.getItemMeta().getLore();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack updateLore() {
|
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++) {
|
for (int i = 0; i < lore.size(); i++) {
|
||||||
|
|
||||||
// Finds the old line in the old lore
|
// Finds the old line in the old lore
|
||||||
|
Loading…
Reference in New Issue
Block a user