diff --git a/util/src/main/java/tc/oc/pgm/util/inventory/tag/LegacyItemTag.java b/util/src/main/java/tc/oc/pgm/util/inventory/tag/LegacyItemTag.java index ed54ad409e..44a29f0d01 100644 --- a/util/src/main/java/tc/oc/pgm/util/inventory/tag/LegacyItemTag.java +++ b/util/src/main/java/tc/oc/pgm/util/inventory/tag/LegacyItemTag.java @@ -10,6 +10,7 @@ import javax.annotation.Nullable; import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.binary.Hex; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -53,8 +54,11 @@ public String get(ItemStack item) { @Override public void set(ItemStack item, String value) { - if (!item.hasItemMeta()) return; ItemMeta itemMeta = item.getItemMeta(); + if (!item.hasItemMeta()) { + // Create missing item meta if none is found + itemMeta = Bukkit.getItemFactory().getItemMeta(item.getType()); + } List lore = itemMeta.getLore(); // If the item has no lore, ensure there is at least 1 line.