Skip to content

refactor: update reflection proxies and improve JSON serialization for player stats#291

Merged
ammodev merged 1 commit into
version/26.1.1from
fix/fix-reflection-proxies
Apr 4, 2026
Merged

refactor: update reflection proxies and improve JSON serialization for player stats#291
ammodev merged 1 commit into
version/26.1.1from
fix/fix-reflection-proxies

Conversation

@ammodev

@ammodev ammodev commented Apr 4, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 4, 2026 19:51
@ammodev ammodev merged commit 321841d into version/26.1.1 Apr 4, 2026
5 of 6 checks passed
@ammodev ammodev deleted the fix/fix-reflection-proxies branch April 4, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the Paper server-side reflection/NMS bridges to align with updated Minecraft internals: player stats JSON is now produced via JsonElement + Gson, and item component mutation is done via registry holder binding instead of a custom reflection proxy.

Changes:

  • Update ServerStatsCounterProxy.toJson to return a JsonElement and expose the underlying static GSON via a reflection-remapper @FieldGetter.
  • Remove the custom ItemProxy reflection abstraction and update item component updates to use builtInRegistryHolder().bindComponents(...).
  • Bump project version to 26.1.1-3.0.3.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
surf-api-paper/surf-api-paper-server/src/main/kotlin/dev/slne/surf/api/paper/server/reflection/ServerStatsCounterProxy.kt Adjust stats JSON proxy to return JsonElement and add static GSON access.
surf-api-paper/surf-api-paper-server/src/main/kotlin/dev/slne/surf/api/paper/server/reflection/Reflection.kt Remove ITEM_PROXY wiring from the central reflection registry.
surf-api-paper/surf-api-paper-server/src/main/kotlin/dev/slne/surf/api/paper/server/reflection/ItemProxy.kt Delete obsolete reflection proxy for mutating Item.components.
surf-api-paper/surf-api-paper-server/src/main/kotlin/dev/slne/surf/api/paper/server/impl/nms/bridges/SurfPaperNmsStatsBridgeImpl.kt Serialize player stats by converting JsonElement to String with the server’s Gson.
surf-api-paper/surf-api-paper-server/src/main/kotlin/dev/slne/surf/api/paper/server/impl/nms/bridges/SurfPaperNmsItemBridgeImpl.kt Switch item component mutation to bindComponents instead of reflection-based field mutation.
gradle.properties Increment version to 26.1.1-3.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants