Feat/post transfer vehicle resync#389
Open
Keviro wants to merge 8 commits into
Open
Conversation
…amless transfers - implement resyncVehicleState to reconcile player's vehicle state after server moves - add resyncEntityForViewer to refresh entity tracking for individual players - introduce resyncPlayerState to restore player abilities lost during seamless transitions
…ods for player mounts - implement captureVehicleNbt to serialize vehicle and passenger data into NBT format - implement restoreVehicleAndMount to recreate vehicle state and mount player at specified location
…passengers in order - implement spawnVehicleTree to recreate vehicle trees from NBT data - add mountPassengersInOrder to restore passenger order after migration - ensure camels stand up correctly after migration to prevent visual issues
Contributor
|
This PR contains changes that modified the public API. To update the reference ABI dumps: ./gradlew updateKotlinAbi
git add **/api/**
git commit -m "Update ABI reference"
git pushAfter updating, the CI will pass. Make sure the changes are backward compatible. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Paper NMS bridge utilities to support seamless server/shard transfers by (a) migrating vehicle trees via NBT and (b) resyncing client tracking/passenger/ability state when the client doesn’t receive a normal respawn/reconfigure sequence.
Changes:
- Extended
SurfPaperNmsPlayerBridgewith vehicle/entity/player resync APIs (vehicle chain re-pairing, single-entity re-pairing, abilities refresh). - Extended
SurfPaperNmsEntityBridgewith vehicle-tree capture/restore/spawn and deterministic passenger mounting helpers. - Implemented the new APIs for NMS versions
v1_21_11,v26_1, andv26_2.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| surf-api-paper/surf-api-paper/src/main/kotlin/dev/slne/surf/api/paper/nms/bridges/SurfPaperNmsPlayerBridge.kt | Adds resync APIs for post-transfer entity/vehicle tracking and player abilities. |
| surf-api-paper/surf-api-paper/src/main/kotlin/dev/slne/surf/api/paper/nms/bridges/SurfPaperNmsEntityBridge.kt | Adds vehicle-tree capture/restore/spawn APIs and ordered passenger remounting. |
| surf-api-paper/surf-api-paper-nms/surf-api-paper-nms-v1-21-11/.../V1_21_11SurfPaperNmsPlayerBridgeImpl.kt | Implements resync APIs (vehicle chain, single entity, abilities) for 1.21.11. |
| surf-api-paper/surf-api-paper-nms/surf-api-paper-nms-v26-1/.../V26_1SurfPaperNmsPlayerBridgeImpl.kt | Implements resync APIs for v26.1. |
| surf-api-paper/surf-api-paper-nms/surf-api-paper-nms-v26-2/.../V26_2SurfPaperNmsPlayerBridgeImpl.kt | Implements resync APIs for v26.2. |
| surf-api-paper/surf-api-paper-nms/surf-api-paper-nms-v1-21-11/.../V1_21_11SurfPaperNmsEntityBridgeImpl.kt | Implements vehicle NBT capture/restore/spawn and ordered passenger mounting for 1.21.11. |
| surf-api-paper/surf-api-paper-nms/surf-api-paper-nms-v26-1/.../V26_1SurfPaperNmsEntityBridgeImpl.kt | Implements vehicle NBT capture/restore/spawn and ordered passenger mounting for v26.1. |
| surf-api-paper/surf-api-paper-nms/surf-api-paper-nms-v26-2/.../V26_2SurfPaperNmsEntityBridgeImpl.kt | Implements vehicle NBT capture/restore/spawn and ordered passenger mounting for v26.2. |
- improve vehicle tree restoration to ensure idempotency and avoid collisions - add checks for existing UUIDs to prevent partial duplicates during restoration - enhance spawning logic to apply target transformations for safe positioning - refactor vehicle UUID collection and validation methods for clarity and efficiency
Contributor
Author
|
bump version |
- update mountPassengersInOrder to ensure all ordered passengers ride the vehicle - enhance logic to stop riding if already mounted on a different vehicle - return true only if all passengers are successfully mounted
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.