aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt54
1 files changed, 29 insertions, 25 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt
index b618f41e2..ad6a29443 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt
@@ -23,30 +23,31 @@ class LorenzTest {
val debugLogger = LorenzLogger("debug/test")
fun printLore() {
- val itemStack = Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem()!!
- print("===")
- print("ITEM LORE")
- print("display name: '" + itemStack.displayName.toString() + "'")
- val itemID = ItemUtil.getSkyBlockItemID(itemStack)
- print("itemID: '$itemID'")
+ try {
+ val itemStack = Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem()!!
+ print("===")
+ print("ITEM LORE")
+ print("display name: '" + itemStack.displayName.toString() + "'")
+ val itemID = ItemUtil.getSkyBlockItemID(itemStack)
+ print("itemID: '$itemID'")
// val rarity: ItemRarityOld = ItemUtils.getRarity(itemStack)
// print("rarity: '$rarity'")
- print("")
- for (line in itemStack.getLore()) {
- print("'$line'")
- println(line)
- }
- print("")
- print("getTagCompound")
- if (itemStack.hasTagCompound()) {
- val tagCompound = itemStack.tagCompound
- for (s in tagCompound.keySet) {
- print(" '$s'")
+ print("")
+ for (line in itemStack.getLore()) {
+ print("'$line'")
+ println(line)
}
- if (tagCompound.hasKey("ExtraAttributes")) {
- print("")
- print("ExtraAttributes")
- val extraAttributes = tagCompound.getCompoundTag("ExtraAttributes")
+ print("")
+ print("getTagCompound")
+ if (itemStack.hasTagCompound()) {
+ val tagCompound = itemStack.tagCompound
+ for (s in tagCompound.keySet) {
+ print(" '$s'")
+ }
+ if (tagCompound.hasKey("ExtraAttributes")) {
+ print("")
+ print("ExtraAttributes")
+ val extraAttributes = tagCompound.getCompoundTag("ExtraAttributes")
// for (s in extraAttributes.keySet) {
// print(" '$s'")
// }
@@ -68,12 +69,15 @@ class LorenzTest {
// }
// }
- runn(extraAttributes, " . ")
+ runn(extraAttributes, " . ")
+ }
}
+ print("")
+ print("===")
+ LorenzUtils.debug("item info printed!")
+ } catch (_: Throwable) {
+ LorenzUtils.error("Hold an item in the hand to see its item infos!")
}
- print("")
- print("===")
- LorenzUtils.debug("item info printed!")
}
fun runn(compound: NBTTagCompound, text: String) {