From 33235af9cb859e2f52672d6b5f2ac5104a6046d5 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:19:09 +0200 Subject: code cleanup --- .../at/hannibal2/skyhanni/test/command/CopyItemCommand.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/test') diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt index cb7031f4b..06496036d 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt @@ -5,13 +5,12 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.OSUtils -import net.minecraft.item.Item +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getMinecraftId import net.minecraft.nbt.NBTTagCompound -import net.minecraft.util.ResourceLocation object CopyItemCommand { - fun command(args: Array) { + fun command() { try { val resultList = mutableListOf() val itemStack = InventoryUtils.getItemInHand() ?: return @@ -19,10 +18,10 @@ object CopyItemCommand { resultList.add("display name: '" + itemStack.displayName.toString() + "'") val itemID = itemStack.getInternalName_old() resultList.add("internalName: '$itemID'") - resultList.add("minecraft id: '" + (Item.itemRegistry.getNameForObject(itemStack.item) as ResourceLocation) + "'") - resultList.add("") + resultList.add("minecraft id: '" + itemStack.getMinecraftId() + "'") + resultList.add("lore:") for (line in itemStack.getLore()) { - resultList.add("'$line'") + resultList.add(" '$line'") } resultList.add("") resultList.add("getTagCompound") @@ -41,6 +40,7 @@ object CopyItemCommand { private fun recurseTag(compound: NBTTagCompound, text: String, list: MutableList) { for (s in compound.keySet) { + if (s == "Lore") continue val tag = compound.getTag(s) if (tag !is NBTTagCompound) { -- cgit