aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2023-08-10 17:44:07 +0200
committerGitHub <noreply@github.com>2023-08-10 17:44:07 +0200
commit9e474fb8fe76b02960b3743e31015018e8666b7f (patch)
tree8ee8f90e00ccdca3471847e0810ae4c91d57ce5d /src/main/java/at/hannibal2/skyhanni/test
parent4d70a91399a6c1724097ef562d5210d2d1ae097a (diff)
downloadskyhanni-9e474fb8fe76b02960b3743e31015018e8666b7f.tar.gz
skyhanni-9e474fb8fe76b02960b3743e31015018e8666b7f.tar.bz2
skyhanni-9e474fb8fe76b02960b3743e31015018e8666b7f.zip
Better Clipboard (#378)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt6
2 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
index 5d36cdb90..fbdb21257 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
@@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.OSUtils
import com.google.gson.JsonElement
import io.github.moulberry.notenoughupdates.util.Shimmy
+import kotlinx.coroutines.launch
import java.lang.reflect.Field
import java.lang.reflect.Modifier
@@ -20,11 +21,13 @@ object SkyHanniConfigSearchResetCommand {
private var lastCommand = emptyArray<String>()
fun command(args: Array<String>) {
- LorenzUtils.chat(runCommand(args))
+ SkyHanniMod.coroutineScope.launch {
+ LorenzUtils.chat(runCommand(args))
+ }
lastCommand = args
}
- private fun runCommand(args: Array<String>): String {
+ private suspend fun runCommand(args: Array<String>): String {
if (args.isEmpty()) {
return "§c[SkyHanni] This is a powerful config-edit command, only use it if you know what you are doing!"
}
@@ -71,7 +74,7 @@ object SkyHanniConfigSearchResetCommand {
}
}
- private fun setCommand(args: Array<String>): String {
+ private suspend fun setCommand(args: Array<String>): String {
if (args.size < 3) return "§c/shconfig set <config name> <json element>"
val term = args[1]
var rawJson = args.drop(2).joinToString(" ")
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt
index a3ddcafd0..2cfb5ae94 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt
@@ -45,6 +45,12 @@ class SkyHanniTestCommand {
fun testCommand(args: Array<String>) {
SoundUtils.playBeepSound()
+ val a = Thread { OSUtils.copyToClipboard("123") }
+ val b = Thread { OSUtils.copyToClipboard("456") }
+ a.start()
+ b.start()
+
+
// for ((i, s) in ScoreboardData.siedebarLinesFormatted().withIndex()) {
// println("$i: '$s'")
// }