Skip to content

fix: restore vehicle seats after wardrobe skin changes - #71

Merged
ryanbarlow97 merged 1 commit into
mainfrom
fix/wardrobe-mount-refresh
Oct 13, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
fix/wardrobe-mount-refresh

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

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.

Documentation: TF-Minecraft/Docs#231

@github-actions github-actions Bot added the size:S 10-29 effective changed lines (tests excluded in mixed PRs). label Oct 13, 2026
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 08ef4bfd-17d5-4aab-953c-120930fe66ca
📥 Commits

Reviewing files that changed from the base of the PR and between c402557 and 029caa6.

📒 Files selected for processing: 6
  • src/main/java/net/tfminecraft/vehicleframework/managers/VehicleManager.java
  • src/main/java/net/tfminecraft/vehicleframework/protocol/VehiclePacketListener.java
  • src/test/java/net/tfminecraft/vehicleframework/VehicleFrameworkCoverageTest.java
  • src/test/java/net/tfminecraft/vehicleframework/bones/BoneRuntimeCoverageTest.java
  • src/test/java/net/tfminecraft/vehicleframework/managers/VehicleManagerCoverageTest.java
  • src/test/java/net/tfminecraft/vehicleframework/protocol/VehiclePacketListenerRespawnTest.java

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.
Respawn packet scheduling
src/main/java/net/tfminecraft/vehicleframework/protocol/VehiclePacketListener.java, src/test/java/net/tfminecraft/vehicleframework/protocol/VehiclePacketListenerRespawnTest.java, src/test/java/net/tfminecraft/vehicleframework/VehicleFrameworkCoverageTest.java, src/test/java/net/tfminecraft/vehicleframework/bones/BoneRuntimeCoverageTest.java
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.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ryanbarlow97
ryanbarlow97 merged commit 799577a into main Oct 13, 2026
3 checks passed
@ryanbarlow97
ryanbarlow97 deleted the fix/wardrobe-mount-refresh branch October 13, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant