aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-22 02:32:27 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-22 02:32:27 +0200
commit1021280302d684071a9bde3cf274a16913eb48ec (patch)
tree43acec5e4ef3eab725ef11ee3ad39dfe673cf8a5 /src/main/java/at/hannibal2/skyhanni/test
parentad946bccdb1dd666f2648434ed3653eaf0b137a1 (diff)
downloadskyhanni-1021280302d684071a9bde3cf274a16913eb48ec.tar.gz
skyhanni-1021280302d684071a9bde3cf274a16913eb48ec.tar.bz2
skyhanni-1021280302d684071a9bde3cf274a16913eb48ec.zip
removed /ii and created /copyitem
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt62
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt48
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt (renamed from src/main/java/at/hannibal2/skyhanni/test/CopyNearbyEntitiesCommand.kt)6
3 files changed, 51 insertions, 65 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt
index d6f90d7b0..e628ec124 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt
@@ -3,12 +3,8 @@ package at.hannibal2.skyhanni.test
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.PacketEvent
import at.hannibal2.skyhanni.utils.GuiRender.renderString
-import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
-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.minecraft.network.play.server.S0EPacketSpawnObject
import net.minecraft.network.play.server.S0FPacketSpawnMob
@@ -28,64 +24,6 @@ class LorenzTest {
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 = itemStack.getInternalName()
- print("internalName: '$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) {
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt
new file mode 100644
index 000000000..854ab26eb
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt
@@ -0,0 +1,48 @@
+package at.hannibal2.skyhanni.test.command
+
+import at.hannibal2.skyhanni.config.gui.utils.Utils
+import at.hannibal2.skyhanni.test.LorenzTest
+import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
+import at.hannibal2.skyhanni.utils.ItemUtils.getLore
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import net.minecraft.client.Minecraft
+
+object CopyItemCommand {
+
+ fun command(args: Array<String>) {
+ try {
+ val resultList = mutableListOf<String>()
+ val itemStack = Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem()!!
+ resultList.add("ITEM LORE")
+ resultList.add("display name: '" + itemStack.displayName.toString() + "'")
+ val itemID = itemStack.getInternalName()
+ resultList.add("internalName: '$itemID'")
+ resultList.add("")
+ for (line in itemStack.getLore()) {
+ resultList.add("'$line'")
+ println(line)
+ }
+ resultList.add("")
+ resultList.add("getTagCompound")
+ if (itemStack.hasTagCompound()) {
+ val tagCompound = itemStack.tagCompound
+ for (s in tagCompound.keySet) {
+ resultList.add(" '$s'")
+ }
+ if (tagCompound.hasKey("ExtraAttributes")) {
+ resultList.add("")
+ resultList.add("ExtraAttributes")
+ val extraAttributes = tagCompound.getCompoundTag("ExtraAttributes")
+ LorenzTest.runn(extraAttributes, " . ")
+ }
+ }
+
+ val string = resultList.joinToString("\n")
+ Utils.copyToClipboard(string)
+ LorenzUtils.debug("item info printed!")
+ LorenzUtils.chat("§e[SkyHanni] item info copied into the clipboard!")
+ } catch (_: Throwable) {
+ LorenzUtils.chat("§c[SkyHanni] No item in hand!")
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/test/CopyNearbyEntitiesCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt
index 262d5892e..c5a05d94a 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/CopyNearbyEntitiesCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt
@@ -1,4 +1,4 @@
-package at.hannibal2.skyhanni.test
+package at.hannibal2.skyhanni.test.command
import at.hannibal2.skyhanni.config.gui.utils.Utils
import at.hannibal2.skyhanni.utils.ItemUtils.cleanName
@@ -96,9 +96,9 @@ object CopyNearbyEntitiesCommand {
if (counter != 0) {
val string = resultList.joinToString("\n")
Utils.copyToClipboard(string)
- LorenzUtils.chat("§e$counter entities copied into the clipboard!")
+ LorenzUtils.chat("§e[SkyHanni] $counter entities copied into the clipboard!")
} else {
- LorenzUtils.chat("§eNo entities found in a search radius of $searchRadius!")
+ LorenzUtils.chat("§e[SkyHanni] No entities found in a search radius of $searchRadius!")
}
}
} \ No newline at end of file