Skip to content

Commit

Permalink
Added support for CustomModelData for gui items in XML files.
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools authored and stefvanschie committed May 31, 2022
1 parent b2218b0 commit eed1a90
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -391,6 +391,12 @@ public static GuiItem loadItem(@NotNull Object instance, @NotNull Element elemen
TextHolder.deserialize(item.getTextContent())
.asItemDisplayName(itemMeta);

itemStack.setItemMeta(itemMeta);
} else if (nodeName.equals("modeldata")) {
ItemMeta itemMeta = Objects.requireNonNull(itemStack.getItemMeta());

itemMeta.setCustomModelData(Integer.parseInt(item.getTextContent()));

itemStack.setItemMeta(itemMeta);
} else if (nodeName.equals("skull") && itemStack.getItemMeta() instanceof SkullMeta) {
SkullMeta skullMeta = (SkullMeta) itemStack.getItemMeta();
Expand Down

0 comments on commit eed1a90

Please sign in to comment.