Feat/scoreboard enhancements - #430
Conversation
- implement viewer line that displays player health in the scoreboard - introduce new utility functions for building dynamic and static lines - refactor scoreboard definition to support viewer-specific components
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Enhances the Paper scoreboard API with viewer-specific rendering and component-builder helpers, backed by Folia-aware per-player scheduling.
Changes:
- Adds viewer-specific lines/components and builder extensions.
- Refactors scoreboard lifecycle and automatic updates for per-viewer sidebars.
- Updates tests and version to 3.45.0.
| File | Description |
|---|---|
| surf-api-paper/surf-api-paper/src/main/kotlin/dev/slne/surf/api/paper/scoreboard/SurfScoreboardBuilder.kt | Updated as part of this pull request. |
| surf-api-paper/surf-api-paper/src/main/kotlin/dev/slne/surf/api/paper/scoreboard/SurfScoreboard.kt | Updated as part of this pull request. |
| surf-api-paper/surf-api-paper/src/main/kotlin/dev/slne/surf/api/paper/scoreboard/scoreboard-extensions.kt | Updated as part of this pull request. |
| surf-api-paper/surf-api-paper/api/surf-api-paper.api | Updated as part of this pull request. |
| surf-api-paper/surf-api-paper-server/src/main/kotlin/dev/slne/surf/api/paper/server/impl/scoreboard/SurfScoreboardImpl.kt | Updated as part of this pull request. |
| surf-api-paper/surf-api-paper-server/src/main/kotlin/dev/slne/surf/api/paper/server/impl/scoreboard/SurfScoreboardBuilderImpl.kt | Updated as part of this pull request. |
| surf-api-paper/surf-api-paper-server/src/main/kotlin/dev/slne/surf/api/paper/server/impl/scoreboard/SurfAutoUpdatableScoreboardImpl.kt | Updated as part of this pull request. |
| surf-api-paper/surf-api-paper-server/src/main/kotlin/dev/slne/surf/api/paper/server/impl/scoreboard/SurfAutoUpdatablePlayerScoreboardImpl.kt | Updated as part of this pull request. |
| surf-api-paper/surf-api-paper-server/src/main/kotlin/dev/slne/surf/api/paper/server/impl/scoreboard/ScoreboardLine.kt | Updated as part of this pull request. |
| surf-api-paper/surf-api-paper-plugin-test/src/main/java/dev/slne/surf/api/paper/test/command/subcommands/scoreboard/CreateScoreboard.java | Updated as part of this pull request. |
| gradle.properties | Updated as part of this pull request. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| sidebarComponentBuilder.build(), | ||
| animations | ||
| lines.toList(), | ||
| snapshots.toList(), |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78c37ca9c4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| override fun addUpdatableLine(line: Supplier<Component>) = apply { | ||
| sidebarComponentBuilder.addDynamicLine(line) | ||
| val snapshot = LineSnapshot(line::get).also { snapshots.add(it) } | ||
| addShared { drawable -> drawable.drawLine(snapshot.value) } |
There was a problem hiding this comment.
Give each built scoreboard its own line snapshots
When one builder containing an updatable line is used to build multiple scoreboards, this closure and snapshots.toList() retain the same mutable LineSnapshot instance in every result. The scoreboards have separate locks, so concurrent updates can overwrite one another's snapshot between refresh and draw, causing one scoreboard to display another scoreboard's supplier result. Create the snapshots and the components that capture them per definition()/build instead of sharing them through the builder.
Useful? React with 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |

No description provided.