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()); } }