aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrady <brady@thatgravyboat.tech>2024-05-26 09:38:30 -0230
committerGitHub <noreply@github.com>2024-05-26 14:08:30 +0200
commit573e8452bf2e9a3e1ca94f736c2b441796ad4b92 (patch)
tree4884fcd3bdece9990a1c42adba77b4a263aea501
parent05d2284401868ba66a916dc75a9ed891ec1d4dc9 (diff)
downloadskyhanni-573e8452bf2e9a3e1ca94f736c2b441796ad4b92.tar.gz
skyhanni-573e8452bf2e9a3e1ca94f736c2b441796ad4b92.tar.bz2
skyhanni-573e8452bf2e9a3e1ca94f736c2b441796ad4b92.zip
Fix: Scoreboard not showing player count in dungeons (#1894)
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
index dd806495e..638c2e0b8 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
@@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.ProfileJoinEvent
import at.hannibal2.skyhanni.events.TabListUpdateEvent
import at.hannibal2.skyhanni.features.bingo.BingoAPI
+import at.hannibal2.skyhanni.features.dungeon.DungeonAPI
import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.ChatUtils
@@ -67,6 +68,13 @@ class HypixelData {
"playeramount.guesting",
"^\\s*(?:§.)*Guests (?:§.)*\\((?<amount>\\d+)\\)\\s*$"
)
+ /**
+ * REGEX-TEST: §r§b§lParty §r§f(4)
+ */
+ private val dungeonPartyAmountPattern by patternGroup.pattern(
+ "playeramount.dungeonparty",
+ "^\\s*(?:§.)+Party (?:§.)+\\((?<amount>\\d+)\\)\\s*$"
+ )
private val soloProfileAmountPattern by patternGroup.pattern(
"solo.profile.amount",
"^\\s*(?:§.)*Island\\s*$"
@@ -159,11 +167,14 @@ class HypixelData {
fun getPlayersOnCurrentServer(): Int {
var amount = 0
- val playerPatternList = listOf(
+ val playerPatternList = mutableListOf(
playerAmountPattern,
playerAmountCoopPattern,
- playerAmountGuestingPattern
+ playerAmountGuestingPattern,
)
+ if (DungeonAPI.inDungeon()) {
+ playerPatternList.add(dungeonPartyAmountPattern)
+ }
out@ for (pattern in playerPatternList) {
for (line in TabListData.getTabList()) {