diff options
author | Lorenz <ESs95s3P5z8Pheb> | 2022-07-15 23:59:52 +0200 |
---|---|---|
committer | Lorenz <ESs95s3P5z8Pheb> | 2022-07-16 00:06:00 +0200 |
commit | 245e1303b1d29ca373509d8190ae20366d5cf2ff (patch) | |
tree | 9d98d2ac688d3a8dec52a20e2833e78bcfc8550b /src/main/java/at/hannibal2/skyhanni/test | |
parent | 3539dbe69a0782c519aa7d0fd38b7b58df154fd8 (diff) | |
download | skyhanni-245e1303b1d29ca373509d8190ae20366d5cf2ff.tar.gz skyhanni-245e1303b1d29ca373509d8190ae20366d5cf2ff.tar.bz2 skyhanni-245e1303b1d29ca373509d8190ae20366d5cf2ff.zip |
added /ii item info command
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt | 78 |
1 files changed, 77 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt index 9cde01cc6..ad6a29443 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt @@ -1,10 +1,16 @@ package at.hannibal2.skyhanni.test import at.hannibal2.skyhanni.SkyHanniMod -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import at.hannibal2.skyhanni.utils.GuiRender.renderString +import at.hannibal2.skyhanni.utils.ItemUtil +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.LorenzDebug import at.hannibal2.skyhanni.utils.LorenzLogger +import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraft.client.Minecraft +import net.minecraft.nbt.NBTTagCompound import net.minecraftforge.client.event.RenderGameOverlayEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class LorenzTest { @@ -15,6 +21,76 @@ class LorenzTest { var text = "" val debugLogger = LorenzLogger("debug/test") + + fun printLore() { + 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'") + } + if (tagCompound.hasKey("ExtraAttributes")) { + print("") + print("ExtraAttributes") + val extraAttributes = tagCompound.getCompoundTag("ExtraAttributes") +// for (s in extraAttributes.keySet) { +// print(" '$s'") +// } +// if (extraAttributes.hasKey("enchantments")) { +// print("") +// print("enchantments") +// val enchantments = extraAttributes.getCompoundTag("enchantments") +// for (s in enchantments.keySet) { +// val level = enchantments.getInteger(s) +// print(" '$s' = $level") +// } +// } +// if (extraAttributes.hasKey("modifier")) { +// print("") +// print("modifier") +// val enchantments = extraAttributes.getCompoundTag("modifier") +// for (s in enchantments.keySet) { +// print(" '$s'") +// } +// } + + runn(extraAttributes, " . ") + } + } + print("") + print("===") + LorenzUtils.debug("item info printed!") + } catch (_: Throwable) { + LorenzUtils.error("Hold an item in the hand to see its item infos!") + } + } + + fun runn(compound: NBTTagCompound, text: String) { + print("$text'$compound'") + for (s in compound.keySet) { + val element = compound.getCompoundTag(s) + runn(element, "$text ") + } + } + + private fun print(text: String) { + LorenzDebug.log(text) + } } @SubscribeEvent |