Skip to content

Feat/post transfer vehicle resync#389

Open
Keviro wants to merge 8 commits into
version/26.2from
feat/post-transfer-vehicle-resync
Open

Feat/post transfer vehicle resync#389
Keviro wants to merge 8 commits into
version/26.2from
feat/post-transfer-vehicle-resync

Conversation

@Keviro

@Keviro Keviro commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Keviro added 3 commits June 23, 2026 00:44
…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
Copilot AI review requested due to automatic review settings June 23, 2026 08:35
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ API/ABI changes detected!

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 push

After updating, the CI will pass. Make sure the changes are backward compatible.

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

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 SurfPaperNmsPlayerBridge with vehicle/entity/player resync APIs (vehicle chain re-pairing, single-entity re-pairing, abilities refresh).
  • Extended SurfPaperNmsEntityBridge with vehicle-tree capture/restore/spawn and deterministic passenger mounting helpers.
  • Implemented the new APIs for NMS versions v1_21_11, v26_1, and v26_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.

Keviro added 2 commits June 23, 2026 11:39
- 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

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

@Keviro Keviro requested a review from twisti-dev June 23, 2026 09:58
@Keviro

Keviro commented Jun 23, 2026

Copy link
Copy Markdown
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
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