aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-19 12:44:25 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-19 12:44:25 +0200
commit4c9b2f977bda0aef5a7e714553d534b60b1ce308 (patch)
treec84138c5b4af65f1f9b192f7dfe89723569508b6
parent28745d981c1ed2008d4ebb71b0b69ba217c1770d (diff)
downloadskyhanni-4c9b2f977bda0aef5a7e714553d534b60b1ce308.tar.gz
skyhanni-4c9b2f977bda0aef5a7e714553d534b60b1ce308.tar.bz2
skyhanni-4c9b2f977bda0aef5a7e714553d534b60b1ce308.zip
Hide chat messages about the Arachne Fight while outside of Arachne's Sanctuary
-rw-r--r--CHANGELOG.md1
-rw-r--r--FEATURES.md1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Chat.java7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/ArachneChatMessageHider.kt50
5 files changed, 60 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 89b6f554e..b2fd4438b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -44,6 +44,7 @@
+ Default disabled
+ Detects your SkyBlock Mod automatically
+ Does detect Chat Triggers and OneConfig itself, but no single mods that require these libraries
++ Added **Arachne Chat Hider** - Hide chat messages about the Arachne Fight while outside of Arachne's Sanctuary
### Changes
+ Added Options for displays Crop Milestone and Best Crop Time.
diff --git a/FEATURES.md b/FEATURES.md
index b6568d9bd..2089efb3f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -20,6 +20,7 @@
- Scan messages sent by players in all-chat for blacklisted words and greys out the message.
- Chat peeking (holding key to display chat without opening the chat gui)
- Compact Potion Effect Messages
+- **Arachne Chat Hider** - Hide chat messages about the Arachne Fight while outside of Arachne's Sanctuary
## Dungeon
- Clicked Blocks (Showing the block behind walls AFTER clicked on a chest, wither essence or a lever)
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 0021299fa..ebe7d2686 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.features.bazaar.BazaarBestSellMethod
import at.hannibal2.skyhanni.features.bazaar.BazaarCancelledBuyOrderClipboard
import at.hannibal2.skyhanni.features.bazaar.BazaarOrderHelper
import at.hannibal2.skyhanni.features.bingo.*
+import at.hannibal2.skyhanni.features.chat.ArachneChatMessageHider
import at.hannibal2.skyhanni.features.chat.ChatFilter
import at.hannibal2.skyhanni.features.chat.PlayerDeathMessages
import at.hannibal2.skyhanni.features.chat.playerchat.PlayerChatFilter
@@ -295,6 +296,7 @@ class SkyHanniMod {
loadModule(DetectBrokenHyperion())
loadModule(RestorePieceOfWizardPortalLore())
loadModule(QuickModMenuSwitch)
+ loadModule(ArachneChatMessageHider())
loadModule(ShowItemUuid())
loadModule(SlayerRngMeterDisplay())
loadModule(GhostCounter)
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java b/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java
index bd60e0eee..f149fc624 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java
@@ -122,10 +122,15 @@ public class Chat {
"except for players who are nearby or during dungeons/a Kuudra fight.")
@ConfigEditorBoolean
public boolean hideFarDeathMessages = false;
- //TODO jawbus + x
+ //TODO jawbus + thunder
@Expose
@ConfigOption(name = "Compact Potion Message", desc = "Shorten chat messages about player potion effects.")
@ConfigEditorBoolean
public boolean compactPotionMessage = true;
+
+ @Expose
+ @ConfigOption(name = "Arachne Hider", desc = "Hide chat messages about the Arachne Fight while outside of §eArachne's Sanctuary§7.")
+ @ConfigEditorBoolean
+ public boolean hideArachneMessages = false;
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ArachneChatMessageHider.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ArachneChatMessageHider.kt
new file mode 100644
index 000000000..d870197c7
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ArachneChatMessageHider.kt
@@ -0,0 +1,50 @@
+package at.hannibal2.skyhanni.features.chat
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.data.IslandType
+import at.hannibal2.skyhanni.events.LorenzChatEvent
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class ArachneChatMessageHider {
+ private val config get() = SkyHanniMod.feature.chat
+ private var hideArachneDeadMessage = false
+ private val arachneCallingPattern = "§4☄ §r.* §r§eplaced an §r§9Arachne's Calling§r§e!.*".toPattern()
+ private val arachneCrystalPattern = "§4☄ §r.* §r§eplaced an Arachne Crystal! Something is awakening!".toPattern()
+
+ @SubscribeEvent
+ fun onChat(event: LorenzChatEvent) {
+ if (!isEnabled()) return
+ if (LorenzUtils.skyBlockIsland != IslandType.SPIDER_DEN) return
+ if (LorenzUtils.skyBlockArea == "Arachne's Sanctuary") return
+
+ if (shouldHide(event.message)) {
+ event.blockedReason = "arachne"
+ }
+ }
+
+ private fun shouldHide(message: String): Boolean {
+
+ arachneCallingPattern.matchMatcher(message) {
+ return true
+ }
+ arachneCrystalPattern.matchMatcher(message) {
+ return true
+ }
+
+ if (message == "§c[BOSS] Arachne§r§f: Ahhhh...A Calling...") return true
+ if (message == "§c[BOSS] Arachne§r§f: The Era of Spiders begins now.") return true
+
+ if (message == "§a§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") {
+ hideArachneDeadMessage = !hideArachneDeadMessage
+ return true
+ }
+ if (message == " §r§6§lARACHNE DOWN!") {
+ hideArachneDeadMessage = true
+ }
+ return hideArachneDeadMessage
+ }
+
+ fun isEnabled() = LorenzUtils.inSkyBlock && config.hideArachneMessages
+}