aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features
diff options
context:
space:
mode:
authorIlmarsXd <ilmars500@gmail.com>2023-02-08 16:21:36 +0200
committerIlmarsXd <ilmars500@gmail.com>2023-02-08 16:21:36 +0200
commit154f612ed8d866755a227b42d5485d3ac08e1d7c (patch)
tree6ec2f3c925e67998cdcb5cb223fdd063eabaca6b /src/main/kotlin/dulkirmod/features
parent695ca674ce4cd4d7565cbdd08986394d65fac90e (diff)
downloadDulkirMod-154f612ed8d866755a227b42d5485d3ac08e1d7c.tar.gz
DulkirMod-154f612ed8d866755a227b42d5485d3ac08e1d7c.tar.bz2
DulkirMod-154f612ed8d866755a227b42d5485d3ac08e1d7c.zip
use TextUtils for messages
Diffstat (limited to 'src/main/kotlin/dulkirmod/features')
-rw-r--r--src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt11
-rw-r--r--src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt4
2 files changed, 8 insertions, 7 deletions
diff --git a/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt b/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt
index c572db0..f6a90eb 100644
--- a/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt
+++ b/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt
@@ -2,6 +2,7 @@ package dulkirmod.features.chat
import dulkirmod.DulkirMod
import dulkirmod.config.Config
+import dulkirmod.utils.TextUtils
import dulkirmod.utils.Utils
import net.minecraftforge.client.event.ClientChatReceivedEvent
@@ -11,11 +12,11 @@ object ThrottleNotif {
if (unformatted == "This menu has been throttled! Please slow down..." && DulkirMod.config.throttleNotifier
&& Utils.isInDungeons()
) {
- event.isCanceled = true;
- if (!Config.throttleNotifierSpam && System.currentTimeMillis() - lastThrottle > 8000) {
- DulkirMod.mc.thePlayer.sendChatMessage("/pc " + DulkirMod.config.customMessage)
- } else {
- DulkirMod.mc.thePlayer.sendChatMessage("/pc " + DulkirMod.config.customMessage)
+ event.isCanceled = true
+ if (!Config.throttleNotifierSpam && System.currentTimeMillis() - lastThrottle > 8000) {
+ TextUtils.sendPartyChatMessage(DulkirMod.config.customMessage)
+ } else if (Config.throttleNotifierSpam) {
+ TextUtils.sendPartyChatMessage(DulkirMod.config.customMessage)
}
lastThrottle = System.currentTimeMillis()
}
diff --git a/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt b/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt
index c7d4349..d607df2 100644
--- a/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt
+++ b/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt
@@ -1,13 +1,13 @@
package dulkirmod.features.chat
-import dulkirmod.DulkirMod
import dulkirmod.config.Config
+import dulkirmod.utils.TextUtils
object VanquisherTrigger {
fun handle(message: String) {
if (!Config.vanqBroadcast) return
if (message == "A Vanquisher is spawning nearby!") {
- DulkirMod.mc.thePlayer.sendChatMessage("/patcher sendcoords")
+ TextUtils.sendMessage("/patcher sendcoords")
}
}
} \ No newline at end of file