diff options
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt')
-rw-r--r-- | src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt | 11 |
1 files changed, 6 insertions, 5 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() } |