aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/chat/DungeonKeyDisplay.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/chat/DungeonKeyDisplay.kt')
-rw-r--r--src/main/kotlin/dulkirmod/features/chat/DungeonKeyDisplay.kt26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/features/chat/DungeonKeyDisplay.kt b/src/main/kotlin/dulkirmod/features/chat/DungeonKeyDisplay.kt
new file mode 100644
index 0000000..2ba01f0
--- /dev/null
+++ b/src/main/kotlin/dulkirmod/features/chat/DungeonKeyDisplay.kt
@@ -0,0 +1,26 @@
+package dulkirmod.features.chat
+
+import dulkirmod.utils.TabListUtils
+
+object DungeonKeyDisplay {
+
+ private val keyPickupMessage = "^(\\[(.*)] )?([a-zA-Z]+) has obtained (Blood|Wither) Key!".toRegex()
+ private val altPickupMessage = "A Wither Key was picked up!".toRegex()
+ private val openMessage = "([a-zA-Z]+) opened a WITHER door!".toRegex()
+ private val altOpenMessage = "The BLOOD DOOR has been opened!".toRegex()
+ var hasKey = false;
+ fun handle(stringUnformatted: String) {
+ if (!TabListUtils.isInDungeons) {
+ hasKey = false
+ return
+ }
+ if (stringUnformatted matches keyPickupMessage || stringUnformatted matches altPickupMessage) {
+ hasKey = true
+ return
+ }
+ if (stringUnformatted matches openMessage || stringUnformatted matches altOpenMessage) {
+ hasKey = false
+ return
+ }
+ }
+} \ No newline at end of file