Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Unknown Perkpocalypse Mayor Chat Spam #2683

Merged
merged 2 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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

Expand Down
Loading