From 0addf9dd07808091040e3f8004ee1710cf69812b Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 11 May 2023 13:17:27 +0200 Subject: Added optional parameter "hidden" -s to /shtestmessage --- src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main') 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 39740a8ec..759cbd9e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt @@ -11,8 +11,10 @@ object TestChatCommand { 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 hidden = args.last() == "-s" + var rawMessage = args.toList().joinToString(" ") + if (!hidden) LorenzUtils.chat("§a[SkyHanni] testing message: §7$rawMessage") + if (hidden) rawMessage = rawMessage.replace(" -s", "") val formattedMessage = rawMessage.replace("&", "§") LorenzUtils.chat(formattedMessage) MinecraftForge.EVENT_BUS.post(ClientChatReceivedEvent(0, ChatComponentText(formattedMessage))) -- cgit