aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-11-19 00:02:48 +0000
committerGitHub <noreply@github.com>2023-11-19 01:02:48 +0100
commit0b1fa4dedc21e997234694d9d11805e4996b54b6 (patch)
tree7bb6d201573f0205bf9ce73f19d65a98fb128e60 /src/main/java/at/hannibal2/skyhanni/test
parentcfa64d7f4360093523029b52dabea8e30ce966b6 (diff)
downloadskyhanni-0b1fa4dedc21e997234694d9d11805e4996b54b6.tar.gz
skyhanni-0b1fa4dedc21e997234694d9d11805e4996b54b6.tar.bz2
skyhanni-0b1fa4dedc21e997234694d9d11805e4996b54b6.zip
Internal Change: Auto-Prefix Chat Messages (#622)
Add auto prefix to chat message methods. #622
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/TestBingo.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt8
10 files changed, 34 insertions, 31 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
index bc5a6c25d..0534c2a72 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
@@ -16,20 +16,21 @@ import kotlinx.coroutines.launch
import java.lang.reflect.Field
import java.lang.reflect.Modifier
+// TODO in the future change something here
object SkyHanniConfigSearchResetCommand {
private var lastCommand = emptyArray<String>()
fun command(args: Array<String>) {
SkyHanniMod.coroutineScope.launch {
- LorenzUtils.chat(runCommand(args))
+ LorenzUtils.chat(runCommand(args), false)
}
lastCommand = args
}
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!"
+ return "§cThis is a powerful config-edit command, only use it if you know what you are doing!"
}
return when (args[0].lowercase()) {
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
index c7461dc24..e6cb3e841 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
@@ -140,7 +140,8 @@ class SkyHanniDebugsAndTests {
LorenzUtils.clickableChat(
"§cTHIS WILL RESET YOUR SkyHanni CONFIG! Click here to procceed.",
- "shconfigmanagerreset confirm"
+ "shconfigmanagerreset confirm",
+ false
)
}
@@ -162,7 +163,7 @@ class SkyHanniDebugsAndTests {
// resetting the MoulConfigProcessor in use
ConfigGuiManager.editor = null
- LorenzUtils.chat("§e[SkyHanni] Reset the config manager!")
+ LorenzUtils.chat("Reset the config manager!")
}.start()
}
@@ -235,7 +236,7 @@ class SkyHanniDebugsAndTests {
println("Skipped registering listener $simpleName")
}
}
- LorenzUtils.chat("§e[SkyHanni] reloaded ${modules.size} listener classes.")
+ LorenzUtils.chat("reloaded ${modules.size} listener classes.")
}
fun stopListeners() {
@@ -246,7 +247,7 @@ class SkyHanniDebugsAndTests {
MinecraftForge.EVENT_BUS.unregister(original)
println("Unregistered listener $simpleName")
}
- LorenzUtils.chat("§e[SkyHanni] stopped ${modules.size} listener classes.")
+ LorenzUtils.chat("stopped ${modules.size} listener classes.")
}
fun copyLocation(args: Array<String>) {
@@ -353,9 +354,9 @@ class SkyHanniDebugsAndTests {
fun toggleRender() {
globalRender = !globalRender
if (globalRender) {
- LorenzUtils.chat("§e[SkyHanni] §aEnabled global renderer!")
+ LorenzUtils.chat("§aEnabled global renderer!")
} else {
- LorenzUtils.chat("§e[SkyHanni] §cDisabled global renderer! Run this command again to show SkyHanni rendering again.")
+ LorenzUtils.chat("§cDisabled global renderer! Run this command again to show SkyHanni rendering again.")
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestBingo.kt b/src/main/java/at/hannibal2/skyhanni/test/TestBingo.kt
index f2eda2892..95832ac46 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/TestBingo.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/TestBingo.kt
@@ -7,6 +7,6 @@ object TestBingo {
fun toggle() {
testBingo = !testBingo
- LorenzUtils.chat("§e[SkyHanni] Test Bingo " + (if (testBingo) "enabled" else "disabled"))
+ LorenzUtils.chat("Test Bingo " + (if (testBingo) "enabled" else "disabled"))
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt b/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt
index a924da86d..6b4362215 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt
@@ -61,7 +61,7 @@ object TestExportTools {
}
val json = toJson(Item, stack)
OSUtils.copyToClipboard(json)
- LorenzUtils.chat("§e[SkyHanni] Compressed item info copied into the clipboard!")
+ LorenzUtils.chat("Compressed item info copied into the clipboard!")
}
@@ -76,4 +76,4 @@ object TestExportTools {
event.move(4, "dev.debug.copyNBTData", "dev.debug.copyItemData")
event.move(4, "dev.debug.copyNBTDataCompressed", "dev.debug.copyItemDataCompressed")
}
-} \ No newline at end of file
+}
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 f0b2c8ae1..6a583b1e3 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt
@@ -14,7 +14,7 @@ object CopyItemCommand {
fun command() {
val itemStack = InventoryUtils.getItemInHand()
if (itemStack == null) {
- LorenzUtils.chat("§c[SkyHanni] No item in hand!")
+ LorenzUtils.userError("No item in hand!")
return
}
copyItemToClipboard(itemStack)
@@ -53,6 +53,6 @@ object CopyItemCommand {
val string = resultList.joinToString("\n")
OSUtils.copyToClipboard(string)
- LorenzUtils.chat("§e[SkyHanni] Item info copied into the clipboard!")
+ LorenzUtils.chat("Item info copied into the clipboard!")
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt
index 97cd1c4ee..dae69775a 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt
@@ -147,9 +147,9 @@ object CopyNearbyEntitiesCommand {
if (counter != 0) {
val string = resultList.joinToString("\n")
OSUtils.copyToClipboard(string)
- LorenzUtils.chat("§e[SkyHanni] $counter entities copied into the clipboard!")
+ LorenzUtils.chat("$counter entities copied into the clipboard!")
} else {
- LorenzUtils.chat("§e[SkyHanni] No entities found in a search radius of $searchRadius!")
+ LorenzUtils.chat("No entities found in a search radius of $searchRadius!")
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt
index 88a6f7f5f..fa7fc2e6e 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt
@@ -41,10 +41,10 @@ object CopyNearbyParticlesCommand {
if (resultList.isEmpty() && tickTime == 0L) tickTime = System.currentTimeMillis()
if (System.currentTimeMillis() > tickTime + 30) {
- if (counter == 0) LorenzUtils.chat("§e[SkyHanni] No particles found nearby, try a larger search radius") else {
+ if (counter == 0) LorenzUtils.chat("No particles found nearby, try a larger search radius") else {
val string = resultList.joinToString("\n")
OSUtils.copyToClipboard(string)
- LorenzUtils.chat("§e[SkyHanni] $counter particles copied into the clipboard!")
+ LorenzUtils.chat("$counter particles copied into the clipboard!")
}
saveNextTick = false
return
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt
index bcc0cfc35..7436ac7f6 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt
@@ -21,6 +21,6 @@ object CopyScoreboardCommand {
val string = resultList.joinToString("\n")
OSUtils.copyToClipboard(string)
- LorenzUtils.chat("§e[SkyHanni] scoreboard copied into your clipboard!")
+ LorenzUtils.chat("Scoreboard copied into your clipboard!")
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt
index c8cbf6a30..258e92ab1 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt
@@ -29,7 +29,7 @@ object ErrorManager {
fun command(array: Array<String>) {
if (array.size != 1) {
- LorenzUtils.chat("§cUse /shcopyerror <error id>")
+ LorenzUtils.userError("Use /shcopyerror <error id>")
return
}
@@ -41,10 +41,10 @@ object ErrorManager {
errorMessages[id]
}
val name = if (fullErrorMessage) "Ful error" else "Error"
- LorenzUtils.chat(errorMessage?.let {
+ LorenzUtils.userError(errorMessage?.let {
OSUtils.copyToClipboard(it)
- "§e[SkyHanni] $name copied into the clipboard, please report it on the SkyHanni discord!"
- } ?: "§c[SkyHanni] Error id not found!")
+ "$name copied into the clipboard, please report it on the SkyHanni discord!"
+ } ?: "Error id not found!")
}
fun logErrorState(userMessage: String, internalMessage: String) {
@@ -79,8 +79,9 @@ object ErrorManager {
"```\nSkyHanni ${SkyHanniMod.version}: $rawMessage\n(full stack trace)\n \n$fullStackTrace\n```"
LorenzUtils.clickableChat(
- "§c[SkyHanni ${SkyHanniMod.version}]: $message§c. Click here to copy the error into the clipboard.",
- "shcopyerror $randomId"
+ "§c[SkyHanni-${SkyHanniMod.version}]: $message§c. Click here to copy the error into the clipboard.",
+ "shcopyerror $randomId",
+ false
)
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt
index 759cbd9e7..49b5982de 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt
@@ -8,15 +8,15 @@ 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")
+ LorenzUtils.userError("Specify a chat message to test!")
return
}
val hidden = args.last() == "-s"
var rawMessage = args.toList().joinToString(" ")
- if (!hidden) LorenzUtils.chat("§a[SkyHanni] testing message: §7$rawMessage")
+ if (!hidden) LorenzUtils.chat("Testing message: §7$rawMessage", prefixColor = "§a")
if (hidden) rawMessage = rawMessage.replace(" -s", "")
val formattedMessage = rawMessage.replace("&", "§")
- LorenzUtils.chat(formattedMessage)
+ LorenzUtils.chat(formattedMessage, false)
MinecraftForge.EVENT_BUS.post(ClientChatReceivedEvent(0, ChatComponentText(formattedMessage)))
}
-} \ No newline at end of file
+}