aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test/command')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt25
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyTabListCommand.kt25
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt20
4 files changed, 72 insertions, 2 deletions
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 92275ed69..10865a213 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt
@@ -1,6 +1,6 @@
package at.hannibal2.skyhanni.test.command
-import at.hannibal2.skyhanni.test.LorenzTest
+import at.hannibal2.skyhanni.test.SkyHanniTestCommand
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.LorenzUtils
@@ -32,7 +32,7 @@ object CopyItemCommand {
resultList.add("")
resultList.add("ExtraAttributes")
val extraAttributes = tagCompound.getCompoundTag("ExtraAttributes")
- LorenzTest.runn(extraAttributes, " . ")
+ SkyHanniTestCommand.runn(extraAttributes, " . ")
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt
new file mode 100644
index 000000000..b53b2af19
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt
@@ -0,0 +1,25 @@
+package at.hannibal2.skyhanni.test.command
+
+import at.hannibal2.skyhanni.data.ScoreboardData
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.OSUtils
+import at.hannibal2.skyhanni.utils.StringUtils.removeColor
+
+object CopyScoreboardCommand {
+ fun command(args: Array<String>) {
+ try {
+ val resultList = mutableListOf<String>()
+ val noColor = args.size == 1 && args[0] == "true"
+ for (line in ScoreboardData.sidebarLinesFormatted) {
+ val scoreboardLine = if (noColor) line.removeColor() else line
+ resultList.add("'$scoreboardLine'")
+ }
+ val string = resultList.joinToString("\n")
+ OSUtils.copyToClipboard(string)
+ LorenzUtils.chat("§e[SkyHanni] scoreboard copied into the clipboard!")
+ }
+ catch (_: Throwable) {
+ LorenzUtils.chat("§c[SkyHanni] Nothing in scoreboard")
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyTabListCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyTabListCommand.kt
new file mode 100644
index 000000000..65ec85d37
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyTabListCommand.kt
@@ -0,0 +1,25 @@
+package at.hannibal2.skyhanni.test.command
+
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.OSUtils
+import at.hannibal2.skyhanni.utils.StringUtils.removeColor
+import at.hannibal2.skyhanni.utils.TabListData
+
+object CopyTabListCommand {
+ fun command(args: Array<String>) {
+ try {
+ val resultList = mutableListOf<String>()
+ val noColor = args.size == 1 && args[0] == "true"
+ for (line in TabListData.getTabList()) {
+ val tabListLine = if (noColor) line.removeColor() else line
+ resultList.add("'$tabListLine'")
+ }
+ val string = resultList.joinToString("\n")
+ OSUtils.copyToClipboard(string)
+ LorenzUtils.chat("§e[SkyHanni] tablist copied into the clipboard!")
+ }
+ catch (_: Throwable) {
+ LorenzUtils.chat("§c[SkyHanni] Nothing in tablist")
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt
new file mode 100644
index 000000000..39740a8ec
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt
@@ -0,0 +1,20 @@
+package at.hannibal2.skyhanni.test.command
+
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import net.minecraft.util.ChatComponentText
+import net.minecraftforge.client.event.ClientChatReceivedEvent
+import net.minecraftforge.common.MinecraftForge
+
+object TestChatCommand {
+ fun command(args: Array<String>) {
+ if (args.isEmpty()) {
+ LorenzUtils.chat("§c[SkyHanni] Specify a chat message to test")
+ return
+ }
+ val rawMessage = args.toList().joinToString(" ")
+ LorenzUtils.chat("§a[SkyHanni] testing message: §7$rawMessage")
+ val formattedMessage = rawMessage.replace("&", "§")
+ LorenzUtils.chat(formattedMessage)
+ MinecraftForge.EVENT_BUS.post(ClientChatReceivedEvent(0, ChatComponentText(formattedMessage)))
+ }
+} \ No newline at end of file