Skip to content

Commit

Permalink
Show item NBT in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Jun 8, 2016
1 parent 08b4868 commit 95a3997
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/mezz/jei/util/ErrorUtil.java
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;

public class ErrorUtil {
Expand Down Expand Up @@ -109,6 +110,11 @@ public static String getItemStackInfo(@Nonnull ItemStack itemStack) {
} else {
itemName = item.getClass().getName();
}

NBTTagCompound nbt = itemStack.getTagCompound();
if (nbt != null) {
return itemStack.toString() + " " + itemName + " nbt:" + nbt;
}
return itemStack.toString() + " " + itemName;
}
}

0 comments on commit 95a3997

Please sign in to comment.