diff options
author | Alexia Luna <me@alexia.lol> | 2024-03-26 18:26:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-26 18:26:19 +0100 |
commit | 871d90100ba2cf45f6544220138a3d62433baf43 (patch) | |
tree | d11d3f8d170c2e6aefa070d51a66dd9319a16cb8 /src/main/java/at/hannibal2/skyhanni | |
parent | f60b9e4c0b71901b362b54959a729d03898aa838 (diff) | |
download | skyhanni-871d90100ba2cf45f6544220138a3d62433baf43.tar.gz skyhanni-871d90100ba2cf45f6544220138a3d62433baf43.tar.bz2 skyhanni-871d90100ba2cf45f6544220138a3d62433baf43.zip |
Improvement: Hide visitor Jacob messages without hiding real Jacob ones (#1267)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/VisitorConfig.java | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/VisitorConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/VisitorConfig.java index 098eddea1..ed1a65661 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/VisitorConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/VisitorConfig.java @@ -84,7 +84,7 @@ public class VisitorConfig { public boolean hypixelArrivedMessage = true; @Expose - @ConfigOption(name = "Hide Chat", desc = "Hide chat messages from the visitors in the garden. (Except Beth, Jacob and Spaceman)") + @ConfigOption(name = "Hide Chat", desc = "Hide chat messages from the visitors in the garden. (Except Beth and Spaceman)") @ConfigEditorBoolean @FeatureToggle public boolean hideChat = true; diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index 82914c66f..f29fd4faf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -89,7 +89,7 @@ class GardenVisitorFeatures { ) private val visitorChatMessagePattern by patternGroup.pattern( "visitorchat", - "§e\\[NPC] (§.)?(?<name>.*)§f: §r.*" + "§e\\[NPC] (?<color>§.)?(?<name>.*)§f: §r.*" ) private val partialAcceptedPattern by patternGroup.pattern( "partialaccepted", @@ -476,8 +476,10 @@ class GardenVisitorFeatures { } private fun hideVisitorMessage(message: String) = visitorChatMessagePattern.matchMatcher(message) { + val color = group("color") + if (color == null || color == "§e") return false // Non-visitor NPC, probably Jacob + val name = group("name") - if (name == "Jacob") return false if (name == "Spaceman") return false if (name == "Beth") return false |