aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-04-21 22:27:17 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-04-21 22:27:17 +0200
commitf978de08fe03fe1808e611ea75bf14cbae904d44 (patch)
treeb18bd86c8ef268a53139d5617ba5986313b6ea46
parentc6828e22528a5b7bbeb8b03c201bf5da9c9072c8 (diff)
downloadskyhanni-f978de08fe03fe1808e611ea75bf14cbae904d44.tar.gz
skyhanni-f978de08fe03fe1808e611ea75bf14cbae904d44.tar.bz2
skyhanni-f978de08fe03fe1808e611ea75bf14cbae904d44.zip
code cleanup
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerChatManager.kt12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerChatManager.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerChatManager.kt
index 2b3efb6aa..e47daa4f2 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerChatManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerChatManager.kt
@@ -110,9 +110,6 @@ class PlayerChatManager {
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
val chatComponent = event.chatComponent
- globalPattern.matchMatcher(event.message) {
- if (isGlobalChat(event)) return
- }
partyPattern.matchMatcher(event.message) {
val author = group("author")
val message = group("message")
@@ -143,6 +140,10 @@ class PlayerChatManager {
// for consistency
val message = "§7$action §r$itemName"
PlayerShowItemChatEvent(levelColor, level, author, message, action, itemName, chatComponent).postChat(event)
+ return
+ }
+ globalPattern.matchMatcher(event.message) {
+ if (isGlobalChat(event)) return
}
sendSystemMessage(event)
@@ -150,11 +151,6 @@ class PlayerChatManager {
private fun Matcher.isGlobalChat(event: LorenzChatEvent): Boolean {
var author = group("author")
- // TODO move into regex
- val isGuild = author.startsWith("§2Guild >")
- val isParty = author.startsWith("§9Party")
- if (isGuild || isParty) return false
-
val message = LorenzUtils.stripVanillaMessage(group("message"))
if (author.contains("[NPC]")) {
NpcChatEvent(author, message.removePrefix("§f"), event.chatComponent).postChat(event)