From ec1fdea40d4e15c5aa032f56748d5f57f7d26d43 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 1 Oct 2019 16:23:59 -0700 Subject: [PATCH] Progress??? --- .../java/com/gmail/nossr50/util/nbt/NBTManager.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 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 e3830438f..e3c26c054 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 @@ -37,22 +37,20 @@ public class NBTManager { NBTTagCompound nbtTagCompound = getNBTCopy(itemStack); player.sendMessage("Total NBT Entries: "+nbtTagCompound.getKeys().size()); - printNBT(nbtTagCompound, player); + printNBT(itemStack, player); player.sendMessage("-- END OF NBT REPORT --"); player.sendMessage("Attempting to add NBT key named - Herp"); addFloatNBT(itemStack, "herp", 13.37F); player.sendMessage("(After HERP) Total NBT Entries: "+nbtTagCompound.getKeys().size()); - printNBT(nbtTagCompound, player); + printNBT(itemStack, player); player.sendMessage("-- END OF NBT REPORT --"); player.sendMessage("Attempting to save NBT data..."); player.updateInventory(); } - - public void addNewNBT(ItemStack itemStack) { } @@ -109,11 +107,12 @@ public class NBTManager { } } - public void printNBT(NBTTagCompound nbtTagCompound, Player player) { - for(String key : nbtTagCompound.getKeys()) { + public void printNBT(ItemStack itemStack, Player player) { + NBTTagCompound tagCompoundCopy = getNBTCopy(itemStack); + for(String key : tagCompoundCopy.getKeys()) { player.sendMessage(""); player.sendMessage("NBT Key: "+key); - player.sendMessage("NBT Value: " + nbtTagCompound.get(key).asString()); + player.sendMessage("NBT Value: " + tagCompoundCopy.get(key).asString()); } }