aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/chat
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/chat')
-rw-r--r--src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt3
-rw-r--r--src/main/kotlin/dulkirmod/features/chat/Bridge.kt6
-rw-r--r--src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt8
3 files changed, 10 insertions, 7 deletions
diff --git a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt
index 1f922f2..d2e0a69 100644
--- a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt
+++ b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt
@@ -42,7 +42,8 @@ class AbiphoneDND {
}
}
if (unformatted.startsWith("✆ Ring...") && unformatted.endsWith("[PICK UP]")
- && System.currentTimeMillis() - lastRing < 5000) {
+ && System.currentTimeMillis() - lastRing < 5000
+ ) {
event.isCanceled = true;
}
}
diff --git a/src/main/kotlin/dulkirmod/features/chat/Bridge.kt b/src/main/kotlin/dulkirmod/features/chat/Bridge.kt
index f413be8..88430af 100644
--- a/src/main/kotlin/dulkirmod/features/chat/Bridge.kt
+++ b/src/main/kotlin/dulkirmod/features/chat/Bridge.kt
@@ -7,8 +7,10 @@ import net.minecraft.util.EnumChatFormatting
import net.minecraftforge.client.event.ClientChatReceivedEvent
object Bridge {
- private val guildFormat = "^(§2Guild|§3Officer) > (?:\\S+ )?([\\w§]{3,18})(?: §[a-z0-9]\\[[A-Z]+])?§f: (\\w+) > .+".toRegex()
- private val alternateFormat = "^(§2Guild|§3Officer) > (?:\\S+ )?([\\w§]{3,18})(?: §[a-z0-9]\\[[A-Z]+])?§f: (\\w+): .+".toRegex()
+ private val guildFormat =
+ "^(§2Guild|§3Officer) > (?:\\S+ )?([\\w§]{3,18})(?: §[a-z0-9]\\[[A-Z]+])?§f: (\\w+) > .+".toRegex()
+ private val alternateFormat =
+ "^(§2Guild|§3Officer) > (?:\\S+ )?([\\w§]{3,18})(?: §[a-z0-9]\\[[A-Z]+])?§f: (\\w+): .+".toRegex()
fun handle(event: ClientChatReceivedEvent) {
val message = event.message.unformattedText
diff --git a/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt b/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt
index ff747eb..c572db0 100644
--- a/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt
+++ b/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt
@@ -6,15 +6,15 @@ import dulkirmod.utils.Utils
import net.minecraftforge.client.event.ClientChatReceivedEvent
object ThrottleNotif {
- private var lastThrottle : Long = 0
+ private var lastThrottle: Long = 0
fun handle(event: ClientChatReceivedEvent, unformatted: String) {
if (unformatted == "This menu has been throttled! Please slow down..." && DulkirMod.config.throttleNotifier
- && Utils.isInDungeons()) {
+ && Utils.isInDungeons()
+ ) {
event.isCanceled = true;
if (!Config.throttleNotifierSpam && System.currentTimeMillis() - lastThrottle > 8000) {
DulkirMod.mc.thePlayer.sendChatMessage("/pc " + DulkirMod.config.customMessage)
- }
- else {
+ } else {
DulkirMod.mc.thePlayer.sendChatMessage("/pc " + DulkirMod.config.customMessage)
}
lastThrottle = System.currentTimeMillis()