Skip to content

Commit

Permalink
Fix GuiItem#copy() not working for air items
Browse files Browse the repository at this point in the history
  • Loading branch information
stefvanschie committed Jul 26, 2024
1 parent 510704b commit a07e628
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,11 @@ public GuiItem copy() {
guiItem.properties = new ArrayList<>(properties);
ItemMeta meta = guiItem.item.getItemMeta();

if (meta == null) {
throw new IllegalArgumentException("item must be able to have ItemMeta (it mustn't be AIR)");
if (meta != null) {
meta.getPersistentDataContainer().set(keyUUID, UUIDTagType.INSTANCE, guiItem.uuid);
guiItem.item.setItemMeta(meta);
}

meta.getPersistentDataContainer().set(keyUUID, UUIDTagType.INSTANCE, guiItem.uuid);
guiItem.item.setItemMeta(meta);

return guiItem;
}

Expand Down

0 comments on commit a07e628

Please sign in to comment.