diff options
| author | inglettronald <inglettronald@gmail.com> | 2023-03-25 04:36:31 -0500 |
|---|---|---|
| committer | inglettronald <inglettronald@gmail.com> | 2023-03-25 04:36:31 -0500 |
| commit | 43d07fc791e63bba61695e0d4b766b78eb699132 (patch) | |
| tree | 69111eb055f0e68fdf388046fb0812f4f3f2f004 /src/main/kotlin/dulkirmod/features/chat | |
| parent | 71af70d22e9a55a58c36642a745e81aa91851375 (diff) | |
| download | DulkirMod-43d07fc791e63bba61695e0d4b766b78eb699132.tar.gz DulkirMod-43d07fc791e63bba61695e0d4b766b78eb699132.tar.bz2 DulkirMod-43d07fc791e63bba61695e0d4b766b78eb699132.zip | |
Config Syntax Change and switch to oneconfig
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/chat')
4 files changed, 19 insertions, 19 deletions
diff --git a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt index 9b429cb..0d6f47f 100644 --- a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt +++ b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt @@ -1,6 +1,6 @@ package dulkirmod.features.chat -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TextUtils import net.minecraftforge.client.event.ClientChatReceivedEvent import net.minecraftforge.client.event.sound.PlaySoundEvent @@ -14,7 +14,7 @@ object AbiphoneDND { //BLOCK ABIPHONE SOUNDS @SubscribeEvent(receiveCanceled = false, priority = EventPriority.LOW) fun onSound(event: PlaySoundEvent) { - if (!Config.abiDND) return + if (!DulkirConfig.abiDND) return if (System.currentTimeMillis() - lastRing < 5000) { if (event.name == "note.pling" && event.sound.volume == 0.69f && event.sound.pitch == 1.6666666f) { event.result = null @@ -23,12 +23,12 @@ object AbiphoneDND { } fun handle(event: ClientChatReceivedEvent, unformatted: String) { - if (!Config.abiDND) return + if (!DulkirConfig.abiDND) return if (unformatted matches abiphoneFormat) { val matchResult = abiphoneFormat.find(unformatted) event.isCanceled = true lastRing = System.currentTimeMillis() - if (Config.abiCallerID) { + if (DulkirConfig.abiCallerID) { val blocked = if (Math.random() < .001) "Breefing" else matchResult?.groups?.get(1)?.value TextUtils.info("§6Call blocked from $blocked!") diff --git a/src/main/kotlin/dulkirmod/features/chat/Bridge.kt b/src/main/kotlin/dulkirmod/features/chat/Bridge.kt index 83efb98..245fe22 100644 --- a/src/main/kotlin/dulkirmod/features/chat/Bridge.kt +++ b/src/main/kotlin/dulkirmod/features/chat/Bridge.kt @@ -1,6 +1,6 @@ package dulkirmod.features.chat -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.Utils import net.minecraft.util.ChatComponentText import net.minecraft.util.EnumChatFormatting @@ -16,12 +16,12 @@ object Bridge { fun handle(event: ClientChatReceivedEvent) { val message = event.message.unformattedText - if (guildFormat matches message && Config.bridgeBot) { + if (guildFormat matches message && DulkirConfig.bridgeBot) { val matchResult = guildFormat.find(message) val (prefix, name, playerName) = matchResult!!.destructured - if (Utils.stripColorCodes(name.lowercase()) == Config.botName.lowercase()) { + if (Utils.stripColorCodes(name.lowercase()) == DulkirConfig.botName.lowercase()) { val newPrefix = if (prefix == "§2Guild") "§2Bridge" else "§3Bridge" - val color = if (Config.bridgeColor == 16) "§z" else EnumChatFormatting.values()[Config.bridgeColor] + val color = if (DulkirConfig.bridgeColor == 16) "§z" else EnumChatFormatting.values()[DulkirConfig.bridgeColor] event.message.siblings[0] = ChatComponentText( "$newPrefix > $color$playerName§f: " ) @@ -32,12 +32,12 @@ object Bridge { } // OTHER FORMAT - else if (alternateFormat matches message && Config.bridgeBot) { + else if (alternateFormat matches message && DulkirConfig.bridgeBot) { val matchResult = alternateFormat.find(message) val (prefix, name, playerName) = matchResult!!.destructured - if (Utils.stripColorCodes(name.lowercase()) == Config.botName.lowercase()) { + if (Utils.stripColorCodes(name.lowercase()) == DulkirConfig.botName.lowercase()) { val newPrefix = if (prefix == "§2Guild") "§2Bridge" else "§3Bridge" - val color = if (Config.bridgeColor == 16) "§z" else EnumChatFormatting.values()[Config.bridgeColor] + val color = if (DulkirConfig.bridgeColor == 16) "§z" else EnumChatFormatting.values()[DulkirConfig.bridgeColor] event.message.siblings[0] = ChatComponentText( "$newPrefix > $color$playerName§f: " ) @@ -47,12 +47,12 @@ object Bridge { } } - else if (otherAltFormat matches message && Config.bridgeBot) { + else if (otherAltFormat matches message && DulkirConfig.bridgeBot) { val matchResult = otherAltFormat.find(message) val (prefix, name, playerName) = matchResult!!.destructured - if (Utils.stripColorCodes(name.lowercase()) == Config.botName.lowercase()) { + if (Utils.stripColorCodes(name.lowercase()) == DulkirConfig.botName.lowercase()) { val newPrefix = if (prefix == "§2Guild") "§2Bridge" else "§3Bridge" - val color = if (Config.bridgeColor == 16) "§z" else EnumChatFormatting.values()[Config.bridgeColor] + val color = if (DulkirConfig.bridgeColor == 16) "§z" else EnumChatFormatting.values()[DulkirConfig.bridgeColor] event.message.siblings[0] = ChatComponentText( "$newPrefix > $color$playerName§f: " ) diff --git a/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt b/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt index fbd2437..736ee43 100644 --- a/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt +++ b/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt @@ -1,7 +1,7 @@ package dulkirmod.features.chat import dulkirmod.DulkirMod -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TabListUtils import dulkirmod.utils.TextUtils import net.minecraftforge.client.event.ClientChatReceivedEvent @@ -13,9 +13,9 @@ object ThrottleNotif { && TabListUtils.isInDungeons ) { event.isCanceled = true - if (!Config.throttleNotifierSpam && System.currentTimeMillis() - lastThrottle > 8000) { + if (!DulkirConfig.throttleNotifierSpam && System.currentTimeMillis() - lastThrottle > 8000) { TextUtils.sendPartyChatMessage(DulkirMod.config.customMessage) - } else if (Config.throttleNotifierSpam) { + } else if (DulkirConfig.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 d607df2..93d15d2 100644 --- a/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt +++ b/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt @@ -1,11 +1,11 @@ package dulkirmod.features.chat -import dulkirmod.config.Config +import dulkirmod.config.DulkirConfig import dulkirmod.utils.TextUtils object VanquisherTrigger { fun handle(message: String) { - if (!Config.vanqBroadcast) return + if (!DulkirConfig.vanqBroadcast) return if (message == "A Vanquisher is spawning nearby!") { TextUtils.sendMessage("/patcher sendcoords") } |
