Skip to content

Commit

Permalink
Improvement: Slight Touch up for Hoppity Event Summary (#2638)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidArthurCole authored Oct 2, 2024
1 parent 2d24eb5 commit b45002e
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,18 @@ object HoppityEventSummary {
config.eventSummary.statDisplayList.forEach {
summaryOperationList[it]?.invoke(statsBuilder, stats, eventYear)
}

// If no stats are found, display a message
if (statsBuilder.toString().replace("\n", "").isEmpty()) {
statsBuilder.appendHeadedLine("§c§lNothing to show!\n§c§oGo find some eggs!")
statsBuilder.appendHeadedLine("§c§lNothing to show!")
statsBuilder.appendHeadedLine("§c§oGo find some eggs!")
}

// Remove any consecutive empty lines in the stats
val statsBuilderString = statsBuilder.toString().replace(Regex("\n{4,}"), "\n".repeat(3))

// Append stats
summaryBuilder.append(statsBuilder)
summaryBuilder.append(statsBuilderString)

// Footer
summaryBuilder.append("§d§l${"".repeat(64)}")
Expand Down

0 comments on commit b45002e

Please sign in to comment.