diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-31 20:28:47 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-31 20:28:47 +0100 |
commit | b5977b31bc5244d047c7963a727c43047e5e2203 (patch) | |
tree | c177caa368036a21acf72faf892a48ece4a83be2 /src/main/java/at | |
parent | fa6338aa9630e22484f82cd51309d2558c0433bb (diff) | |
download | skyhanni-b5977b31bc5244d047c7963a727c43047e5e2203.tar.gz skyhanni-b5977b31bc5244d047c7963a727c43047e5e2203.tar.bz2 skyhanni-b5977b31bc5244d047c7963a727c43047e5e2203.zip |
fixed dungeon api using two chat events
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt index f9403af94..c1d8415e0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt @@ -136,14 +136,21 @@ class DungeonAPI { @SubscribeEvent fun onChat(event: LorenzChatEvent) { - val floor = dungeonFloor - if (floor != null) { - if (event.message == "§e[NPC] §bMort§f: §rHere, I found this map when I first entered the dungeon.") { - started = true - DungeonStartEvent(floor).postAndCatch() - } - if (event.message.removeColor().matches(uniqueClassBonus)) { - isUniqueClass = true + val floor = dungeonFloor ?: return + if (event.message == "§e[NPC] §bMort§f: §rHere, I found this map when I first entered the dungeon.") { + started = true + DungeonStartEvent(floor).postAndCatch() + } + if (event.message.removeColor().matches(uniqueClassBonus)) { + isUniqueClass = true + } + + if (!LorenzUtils.inSkyBlock) return + killPattern.matchMatcher(event.message.removeColor()) { + val bossCollections = bossStorage ?: return + val boss = DungeonFloor.byBossName(group("boss")) + if (matches() && boss != null && boss !in bossCollections) { + bossCollections.addOrPut(boss, 1) } } } @@ -210,18 +217,6 @@ class DungeonAPI { } @SubscribeEvent - fun onChat(event: LorenzChatEvent) { - if (!LorenzUtils.inDungeons) return - killPattern.matchMatcher(event.message.removeColor()) { - val bossCollections = bossStorage ?: return - val boss = DungeonFloor.byBossName(group("boss")) - if (matches() && boss != null && boss !in bossCollections) { - bossCollections.addOrPut(boss, 1) - } - } - } - - @SubscribeEvent fun onDebugDataCollect(event: DebugDataCollectEvent) { event.title("Dungeon") |