aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt9
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"