aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-10-06 22:02:48 +0200
committerGitHub <noreply@github.com>2024-10-06 22:02:48 +0200
commit4df35d062a41f0e8fed82caf2249c2e71f5b4058 (patch)
treedbf761eeeb39933596a21ad1e5db00ffb4fd9ef0 /src/main/java/at
parent3326753f29824791df28a941e2f4fc239992c9f1 (diff)
downloadskyhanni-4df35d062a41f0e8fed82caf2249c2e71f5b4058.tar.gz
skyhanni-4df35d062a41f0e8fed82caf2249c2e71f5b4058.tar.bz2
skyhanni-4df35d062a41f0e8fed82caf2249c2e71f5b4058.zip
Fix: Unknown Perkpocalypse Mayor Chat Spam (#2683)
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt
index 469c48489..a07960231 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt
@@ -170,7 +170,7 @@ object MayorAPI {
} ?: false
} ?: return
- val perk = stack.getLore().nextAfter({ perkpocalypsePerksPattern.matches(it) }) ?: return
+ val perk = stack.getLore().nextAfter({ perkpocalypsePerksPattern.matches(it) }, 2) ?: return
// This is the first Perk of the Perkpocalypse Mayor
val jerryMayor = getMayorFromPerk(getPerkFromName(perk.removeColor()) ?: return)?.addAllPerks() ?: return
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
index 769184077..e1c5d3f84 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
@@ -784,6 +784,11 @@ private fun getMayorDisplayPair() = buildList {
}
if (!mayorConfig.showExtraMayor) return@buildList
+ addAll(addMinister())
+ addAll(addPerkpocalypseMayor())
+}
+
+private fun addMinister() = buildList {
val ministerName = MayorAPI.currentMinister?.mayorName?.let { MayorAPI.mayorNameWithColorCode(it) } ?: return@buildList
add(ministerName to HorizontalAlignment.LEFT)
@@ -792,7 +797,9 @@ private fun getMayorDisplayPair() = buildList {
add(" §7- §e${perk.perkName}" to HorizontalAlignment.LEFT)
}
}
+}
+private fun addPerkpocalypseMayor() = buildList {
val jerryExtraMayor = MayorAPI.jerryExtraMayor
val extraMayor = jerryExtraMayor.first ?: return@buildList