From 365938f35123db69341ab20fbadc1ad2c1cc2690 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 1 Oct 2019 16:33:31 -0700 Subject: [PATCH] ItemMeta needed? --- .../main/java/com/gmail/nossr50/util/nbt/NBTManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mcmmo-core/src/main/java/com/gmail/nossr50/util/nbt/NBTManager.java b/mcmmo-core/src/main/java/com/gmail/nossr50/util/nbt/NBTManager.java index fe6e2129e..8c5ef16d8 100644 --- a/mcmmo-core/src/main/java/com/gmail/nossr50/util/nbt/NBTManager.java +++ b/mcmmo-core/src/main/java/com/gmail/nossr50/util/nbt/NBTManager.java @@ -76,10 +76,14 @@ public class NBTManager { //Invoke load() time applyNBT(nmsIS, updatedNBT); + + //Apply Item Meta (Not sure if needed) + CraftItemStack craftItemStack = CraftItemStack.asCraftMirror(nmsIS); + itemStack.setItemMeta(craftItemStack.getItemMeta()); } - public net.minecraft.server.v1_14_R1.ItemStack applyNBT(net.minecraft.server.v1_14_R1.ItemStack nmsItemStack, NBTTagCompound nbtTagCompound) { + public void applyNBT(net.minecraft.server.v1_14_R1.ItemStack nmsItemStack, NBTTagCompound nbtTagCompound) { try { Class clazz = Class.forName("net.minecraft.server.v1_14_R1.ItemStack"); @@ -90,8 +94,6 @@ public class NBTManager { } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { e.printStackTrace(); } - - return nmsItemStack; } public NBTBase constructNBT(String nbtString) {