aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/chat
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-06 11:46:08 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-06 11:46:08 +0200
commitbfa53ca5b4cb9a0ef31256746612cb6289b06a49 (patch)
tree949cf71ede55fbb7ee33bfec0fcf9ec32873b8d5 /src/main/java/at/hannibal2/skyhanni/chat
parent283a986d3d0f84afc5c38fb4c8465abc5de0d2b2 (diff)
downloadskyhanni-bfa53ca5b4cb9a0ef31256746612cb6289b06a49.tar.gz
skyhanni-bfa53ca5b4cb9a0ef31256746612cb6289b06a49.tar.bz2
skyhanni-bfa53ca5b4cb9a0ef31256746612cb6289b06a49.zip
Merge branch 'master' of C:\Users\Lorenz\IdeaProjects\SkyHanni with conflicts.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/chat')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/chat/ChatFilter.kt19
-rw-r--r--src/main/java/at/hannibal2/skyhanni/chat/NewChatFilter.kt18
2 files changed, 36 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/chat/ChatFilter.kt
index fc245405c..7efbf2ff6 100644
--- a/src/main/java/at/hannibal2/skyhanni/chat/ChatFilter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/chat/ChatFilter.kt
@@ -37,11 +37,28 @@ class ChatFilter {
winterIsland(message) && SkyHanniMod.feature.chat.others -> "winter_island"
uselessWarning(message) && SkyHanniMod.feature.chat.others -> "useless_warning"
friendJoin(message) && SkyHanniMod.feature.chat.others -> "friend_join"
+ annoyingSpam(message) && SkyHanniMod.feature.chat.others -> "annoying_spam"
+ else -> ""
+ }
+ //TODO split into others
+ private fun annoyingSpam(message: String): Boolean {
+ if (message.matchRegex("§7Your Implosion hit (.*) for §r§c(.*) §r§7damage.")) return true
+ if (message.matchRegex("§7Your Molten Wave hit (.*) for §r§c(.*) §r§7damage.")) return true
+ if (message == "§cThere are blocks in the way!") return true
+ if (message == "§aYour Blessing enchant got you double drops!") return true
+ if (message == "§cYou can't use the wardrobe in combat!") return true
+ if (message == "§6§lGOOD CATCH! §r§bYou found a §r§fFish Bait§r§b.") return true
+ if (message == "§6§lGOOD CATCH! §r§bYou found a §r§aGrand Experience Bottle§r§b.") return true
+ if (message == "§6§lGOOD CATCH! §r§bYou found a §r§aBlessed Bait§r§b.") return true
+ if (message == "§6§lGOOD CATCH! §r§bYou found a §r§fDark Bait§r§b.") return true
+ if (message == "§6§lGOOD CATCH! §r§bYou found a §r§fLight Bait§r§b.") return true
+ if (message == "§6§lGOOD CATCH! §r§bYou found a §r§aHot Bait§r§b.") return true
+ if (message == "§6§lGOOD CATCH! §r§bYou found a §r§fSpooky Bait§r§b.") return true
- else -> ""
+ return false
}
private fun friendJoin(message: String): Boolean {
diff --git a/src/main/java/at/hannibal2/skyhanni/chat/NewChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/chat/NewChatFilter.kt
new file mode 100644
index 000000000..b72f4fd4b
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/chat/NewChatFilter.kt
@@ -0,0 +1,18 @@
+package at.hannibal2.skyhanni.chat
+
+import at.hannibal2.skyhanni.events.LorenzChatEvent
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class NewChatFilter {
+
+ @SubscribeEvent
+ fun onChatMessage(event: LorenzChatEvent) {
+ if (!LorenzUtils.isOnHypixel) return
+
+// val blockReason = block(event.message)
+// if (blockReason != "") {
+// event.blockedReason = blockReason
+// }
+ }
+} \ No newline at end of file