You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: restore vehicle seats after wardrobe skin changes - #71
Changing a wardrobe skin while seated sends a client respawn and clears the client's vehicle view. VehicleFramework and ModelEngine still report a healthy mount, so the rider falls and receives repeated position corrections.
Restore the current seat on the next server tick after an outgoing respawn packet. Recovery checks the current login session, living player, valid vehicle, world and seat occupant, and uses the existing mount/rejection handling. It does not reload the vehicle or eject its other passengers.
Validation:
TFMC_MVN_REMOTE=1 tfmc-mvn -o -B --no-transfer-progress clean verify: 1,711 tests passed on CachyOS; 100% production line coverage.
Regression tests cover intact server mount tracking, departed seats, death, world changes, cancelled packets and replaced login sessions.
Runtime JAR filename and embedded version validation passed.
Live Paper 1.21.10 / ModelEngine R4.1.1 test with the deployed wardrobe helper and a vanilla client: two skin refreshes, 35 seconds each, no manual remount, no movement warnings; flight controls remained usable.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Summary
Summary by CodeRabbit
Bug Fixes
Players riding vehicles are now reattached to their seat after respawning, provided the player and vehicle are still available in the same world and the seat remains assigned to them. This prevents eligible riders from being unintentionally separated from their vehicle during the respawn process. Cancelled respawns and cases where the player or vehicle is no longer eligible do not trigger reattachment.
A respawn packet now schedules a mount refresh one tick later when it is not cancelled and the same player remains online. The refresh reattaches an eligible player to their existing vehicle seat.
Changes: Respawn mount refresh
Layer / File(s)
Summary
Guarded mount reattachment src/main/java/net/tfminecraft/vehicleframework/managers/VehicleManager.java, src/test/java/net/tfminecraft/vehicleframework/managers/VehicleManagerCoverageTest.java
refreshPlayerMount(Player) checks player, vehicle, entity, world and seat state before dismounting and reattaching the player. Tests cover eligible and ineligible states.
The listener observes server RESPAWN packets at MONITOR priority and schedules the refresh one tick later for a non-cancelled event if the same player remains online. Tests cover cancellation, disconnects, replacement logins and listener registration.
sequenceDiagram
participant Server
participant VehiclePacketListener
participant BukkitScheduler
participant VehicleManager
participant Player
Server->>VehiclePacketListener: Send RESPAWN packet event
VehiclePacketListener->>BukkitScheduler: Schedule refresh one tick later
BukkitScheduler->>VehiclePacketListener: Run scheduled task
VehiclePacketListener->>Player: Check online player identity
VehiclePacketListener->>VehicleManager: Refresh player's mount
Loading
Merge Risk:⚪ Minimal · up to 029ca
The mount-refresh change appears ready to merge after normal checks.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
size:S10-29 effective changed lines (tests excluded in mixed PRs).
1 participant
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.
Changing a wardrobe skin while seated sends a client respawn and clears the client's vehicle view. VehicleFramework and ModelEngine still report a healthy mount, so the rider falls and receives repeated position corrections.
Restore the current seat on the next server tick after an outgoing respawn packet. Recovery checks the current login session, living player, valid vehicle, world and seat occupant, and uses the existing mount/rejection handling. It does not reload the vehicle or eject its other passengers.
Validation:
TFMC_MVN_REMOTE=1 tfmc-mvn -o -B --no-transfer-progress clean verify: 1,711 tests passed on CachyOS; 100% production line coverage.Documentation: TF-Minecraft/Docs#231