aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc/woverflow/chatting/chat
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/cc/woverflow/chatting/chat')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatSearchingManager.kt6
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt4
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatTabs.kt128
3 files changed, 69 insertions, 69 deletions
diff --git a/src/main/kotlin/cc/woverflow/chatting/chat/ChatSearchingManager.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatSearchingManager.kt
index 1e08719..25d479a 100644
--- a/src/main/kotlin/cc/woverflow/chatting/chat/ChatSearchingManager.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatSearchingManager.kt
@@ -1,9 +1,9 @@
package cc.woverflow.chatting.chat
+import cc.polyfrost.oneconfig.libs.caffeine.cache.Cache
+import cc.polyfrost.oneconfig.libs.caffeine.cache.Caffeine
+import cc.polyfrost.oneconfig.libs.universal.wrappers.message.UTextComponent
import cc.woverflow.chatting.hook.GuiNewChatHook
-import gg.essential.lib.caffeine.cache.Cache
-import gg.essential.lib.caffeine.cache.Caffeine
-import gg.essential.universal.wrappers.message.UTextComponent
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.ChatLine
import java.util.concurrent.LinkedBlockingQueue
diff --git a/src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt
index 91ea6b5..471eec8 100644
--- a/src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt
@@ -37,7 +37,7 @@ object ChatSpamBlock {
if (!ChattingConfig.customChatFormatting) {
newMessage += rank
}
- newMessage += "$player${EnumChatFormatting.DARK_GRAY.toString()}: $content"
+ newMessage += "$player${EnumChatFormatting.DARK_GRAY}: $content"
event.message = ChatComponentText(newMessage)
}
return
@@ -67,7 +67,7 @@ object ChatSpamBlock {
}
if (message.replace(Regex("[\\w\\s]"), "").length > 2) {
tokens.add("SPECIAL_CHARS")
- } else if (message.replace(Regex("[\\w\\s]"), "").length > 0) {
+ } else if (message.replace(Regex("[\\w\\s]"), "").isNotEmpty()) {
tokens.add("SPECIAL_CHAR")
} else {
tokens.add("LOW_SPECIAL_CHARS")
diff --git a/src/main/kotlin/cc/woverflow/chatting/chat/ChatTabs.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTabs.kt
index cdec672..62c2760 100644
--- a/src/main/kotlin/cc/woverflow/chatting/chat/ChatTabs.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTabs.kt
@@ -135,31 +135,31 @@ object ChatTabs {
val all = ChatTab(
true,
"ALL",
- false,
- false,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- TabButton.color,
- TabButton.hoveredColor,
- TabButton.selectedColor,
- ""
+ unformatted = false,
+ lowercase = false,
+ startsWith = null,
+ contains = null,
+ endsWith = null,
+ equals = null,
+ uncompiledRegex = null,
+ ignoreStartsWith = null,
+ ignoreContains = null,
+ ignoreEndsWith = null,
+ ignoreEquals = null,
+ uncompiledIgnoreRegex = null,
+ color = TabButton.color,
+ hoveredColor = TabButton.hoveredColor,
+ selectedColor = TabButton.selectedColor,
+ prefix = ""
)
val party = ChatTab(
true,
"PARTY",
- false,
- false,
- listOf("§r§9Party §8> ", "§r§9P §8> ", "§eThe party was transferred to §r", "§eKicked §r"),
- null,
- listOf(
+ unformatted = false,
+ lowercase = false,
+ startsWith = listOf("§r§9Party §8> ", "§r§9P §8> ", "§eThe party was transferred to §r", "§eKicked §r"),
+ contains = null,
+ endsWith = listOf(
"§r§ehas invited you to join their party!",
"§r§eto the party! They have §r§c60 §r§eseconds to accept.§r",
"§r§ehas disbanded the party!§r",
@@ -169,8 +169,8 @@ object ChatTabs {
" §r§ehas been removed from the party.§r",
"§r§e because they were offline.§r"
),
- listOf("§cThe party was disbanded because all invites expired and the party was empty§r"),
- listOf( //regexes from https://github.com/kwevin/Hychat-Tabs/blob/main/tabs/re-add%20prefixes%20%26%20fix%20shortened%20tags/chat.json cause i cant write regex
+ equals = listOf("§cThe party was disbanded because all invites expired and the party was empty§r"),
+ uncompiledRegex = listOf( //regexes from https://github.com/kwevin/Hychat-Tabs/blob/main/tabs/re-add%20prefixes%20%26%20fix%20shortened%20tags/chat.json cause i cant write regex
"(§r)*(§9Party §8\u003e)+(.*)",
"(?:(?:§[a-zA-Z0-9])*\\[(?:(?:VIP)|(?:VIP§r§6\\+)|(?:MVP)|(?:MVP(?:§r)?(?:§[a-zA-Z0-9])\\+)|(?:MVP(?:§r)?(?:§[a-zA-Z0-9])\\+\\+)|(?:(?:§r)?§fYOUTUBE))(?:§r)?(?:(?:§[a-zA-Z0-9]))?\\] [a-zA-Z0-9_]+|§7[a-zA-Z0-9_]+) §r§einvited §r(?:(?:§[a-zA-Z0-9])*\\[(?:(?:VIP)|(?:VIP§r§6\\+)|(?:MVP)|(?:MVP(?:§r)?(?:§[a-zA-Z0-9])\\+)|(?:MVP(?:§r)?(?:§[a-zA-Z0-9])\\+\\+)|(?:(?:§r)?§fYOUTUBE))(?:§r)?(?:(?:§[a-zA-Z0-9]))?\\] [a-zA-Z0-9_]+|§7[a-zA-Z0-9_]+) §r§eto the party! They have §r§c60 §r§eseconds to accept\\.§r",
"(?:(?:§[a-zA-Z0-9])*\\[(?:(?:VIP)|(?:VIP§r§6\\+)|(?:MVP)|(?:MVP(?:§r)?(?:§[a-zA-Z0-9])\\+)|(?:MVP(?:§r)?(?:§[a-zA-Z0-9])\\+\\+)|(?:(?:§r)?§fYOUTUBE))(?:§r)?(?:(?:§[a-zA-Z0-9]))?\\] [a-zA-Z0-9_]+|§7[a-zA-Z0-9_]+) §r§ehas left the party\\.§r",
@@ -211,55 +211,55 @@ object ChatTabs {
"§cThis party is currently muted\\.§r",
"(§r)*(§9P §8\u003e)+(.*)"
),
- null,
- null,
- null,
- null,
- null,
- TabButton.color,
- TabButton.hoveredColor,
- TabButton.selectedColor,
- "/pc "
+ ignoreStartsWith = null,
+ ignoreContains = null,
+ ignoreEndsWith = null,
+ ignoreEquals = null,
+ uncompiledIgnoreRegex = null,
+ color = TabButton.color,
+ hoveredColor = TabButton.hoveredColor,
+ selectedColor = TabButton.selectedColor,
+ prefix = "/pc "
)
val guild = ChatTab(
true,
"GUILD",
- true,
- false,
- listOf("Guild >", "G >"),
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- TabButton.color,
- TabButton.hoveredColor,
- TabButton.selectedColor,
- "/gc "
+ unformatted = true,
+ lowercase = false,
+ startsWith = listOf("Guild >", "G >"),
+ contains = null,
+ endsWith = null,
+ equals = null,
+ uncompiledRegex = null,
+ ignoreStartsWith = null,
+ ignoreContains = null,
+ ignoreEndsWith = null,
+ ignoreEquals = null,
+ uncompiledIgnoreRegex = null,
+ color = TabButton.color,
+ hoveredColor = TabButton.hoveredColor,
+ selectedColor = TabButton.selectedColor,
+ prefix = "/gc "
)
val pm = ChatTab(
true,
"PM",
- true,
- false,
- listOf("To ", "From "),
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- TabButton.color,
- TabButton.hoveredColor,
- TabButton.selectedColor,
- "/r "
+ unformatted = true,
+ lowercase = false,
+ startsWith = listOf("To ", "From "),
+ contains = null,
+ endsWith = null,
+ equals = null,
+ uncompiledRegex = null,
+ ignoreStartsWith = null,
+ ignoreContains = null,
+ ignoreEndsWith = null,
+ ignoreEquals = null,
+ uncompiledIgnoreRegex = null,
+ color = TabButton.color,
+ hoveredColor = TabButton.hoveredColor,
+ selectedColor = TabButton.selectedColor,
+ prefix = "/r "
)
tabs.add(all)
tabs.add(party)