diff options
author | David Cole <40234707+DavidArthurCole@users.noreply.github.com> | 2024-06-30 06:42:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-30 12:42:50 +0200 |
commit | e1c195aa3656d4ca1bceb1764818654a2b081288 (patch) | |
tree | 7c1ed4ff31bd6e2ab9291abdafc7d2f9b70a1723 /src/main/java/at | |
parent | 4a55a7d4d8c3551cc4cfa3bd82867579494e3c70 (diff) | |
download | skyhanni-e1c195aa3656d4ca1bceb1764818654a2b081288.tar.gz skyhanni-e1c195aa3656d4ca1bceb1764818654a2b081288.tar.bz2 skyhanni-e1c195aa3656d4ca1bceb1764818654a2b081288.zip |
Feature: Block achievements message spam on Alpha (#2076)
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java index ebab020bc..c87102b5b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java @@ -106,6 +106,11 @@ public class FilterTypesConfig { @FeatureToggle public boolean sacrifice = false; + @Expose + @ConfigOption(name = "Block Alpha Achievements", desc = "Hide achievement messages while on the Alpha network.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideAlphaAchievements = false; //TODO remove @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt index f424b52a3..fca2582c9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.chat import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator +import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.dungeon.DungeonAPI import at.hannibal2.skyhanni.features.garden.GardenAPI @@ -408,6 +409,11 @@ object ChatFilter { "§d[\\w']+ the Fairy§r§f: Have a great life!".toPattern() ) + // §e§ka§a>> §aAchievement Unlocked: §6§r§6Agile§r§a <<§e§ka + private val achievementGetPatterns = listOf( + "§e§k.§a>> {3}§aAchievement Unlocked: .* {3}<<§e§k.".toPattern() + ) + private val patternsMap: Map<String, List<Pattern>> = mapOf( "lobby" to lobbyPatterns, "warping" to warpingPatterns, @@ -430,6 +436,7 @@ object ChatFilter { "solo_class" to soloClassPatterns, "solo_stats" to soloStatsPatterns, "fairy" to fairyPatterns, + "achievement_get" to achievementGetPatterns, ) private val messagesMap: Map<String, List<String>> = mapOf( @@ -481,6 +488,8 @@ object ChatFilter { config.killCombo && message.isPresent("kill_combo") -> "kill_combo" config.profileJoin && message.isPresent("profile_join") -> "profile_join" + config.hideAlphaAchievements && HypixelData.hypixelAlpha && message.isPresent("achievement_get") -> "achievement_get" + config.others && isOthers(message) -> othersMsg config.winterGift && message.isPresent("winter_gift") -> "winter_gift" |