aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-10-16 22:03:12 +1100
committerGitHub <noreply@github.com>2024-10-16 13:03:12 +0200
commit1d79bb1e97153db7f32df4bb46b7a97c2cfd0ff3 (patch)
tree889401a9b74c79d2b355c3b28a6ad674d89fed19 /src/main/java
parent17b3900dabc7ba6d73e9fc50c4936f408314f30d (diff)
downloadskyhanni-1d79bb1e97153db7f32df4bb46b7a97c2cfd0ff3.tar.gz
skyhanni-1d79bb1e97153db7f32df4bb46b7a97c2cfd0ff3.tar.bz2
skyhanni-1d79bb1e97153db7f32df4bb46b7a97c2cfd0ff3.zip
Fix: Stop SkyHanni messages from being sent twice by accident (#2736)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt
index c923d1dee..2187ab9a9 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt
@@ -92,15 +92,15 @@ object ChatUtils {
): Boolean {
val text = ChatComponentText(message)
- if (replaceSameMessage) {
+ return if (replaceSameMessage) {
text.send(getUniqueMessageIdForString(message))
+ chat(text, false)
} else {
chat(text)
}
- return chat(text)
}
- fun chat(message: IChatComponent): Boolean {
+ fun chat(message: IChatComponent, send: Boolean = true): Boolean {
val formattedMessage = message.getFormattedTextCompat()
log.log(formattedMessage)
@@ -116,7 +116,7 @@ object ChatUtils {
return false
}
- thePlayer.addChatMessage(message)
+ if (send) thePlayer.addChatMessage(message)
return true
}