From bfa53ca5b4cb9a0ef31256746612cb6289b06a49 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Sat, 6 Aug 2022 11:46:08 +0200 Subject: Merge branch 'master' of C:\Users\Lorenz\IdeaProjects\SkyHanni with conflicts. --- .../java/at/hannibal2/skyhanni/chat/ChatFilter.kt | 19 ++++++++++++++++++- .../java/at/hannibal2/skyhanni/chat/NewChatFilter.kt | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/chat/NewChatFilter.kt (limited to 'src/main/java/at/hannibal2/skyhanni/chat') 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 -- cgit