-
Notifications
You must be signed in to change notification settings - Fork 161
Entity rideable feature #1119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Entity rideable feature #1119
Conversation
session: Set `EmoteFlagMuteChat` if emote chat muted. (df-mc#1116)
- Downgrade Go version from 1.24 to 1.25.0 to match project requirements - Update all dependency versions to latest compatible releases - Completely redesign entity riding interface with proper Rider and Rideable contracts - Implement mount/dismount handlers in player handler interface - Add rider state tracking in player data structure - Implement entity metadata synchronization for riding state - Handle vehicle interactions in inventory transaction system - Propagate movement inputs from riders to ridden entities - Add viewer methods for entity mount/dismount events - Ensure proper cleanup on player close with automatic dismount
- Change seat position vectors from mgl64.Vec3 to mgl32.Vec3 for protocol compatibility - Update all method signatures and field types to use mgl32.Vec3 consistently
TwistedAsylumMC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for picking up on the old PR, it's very appreciated. I've left a few comments in the code but I do have one other concern.
There's currently no way for the ridden entity to control how many riders it can have but also where the seats are, which I feel like it's something that should happen. From what I can tell, any player can go up to the same entity and start riding it, ending up in the same place as everyone else unless a player handler changes this? Rideable() should most likely have some sort of method that allows controlling this, providing the seat positions etc.
- Replace seat position vectors with seat index system for better protocol compatibility - Implement seat management with NextFreeSeatIndex method on Rideable entities - Add seat position lookup method that calculates position from seat index - Change mount/dismount handler signatures to use seat index instead of position - Update entity metadata to use calculated seat positions instead of stored vectors - Maintain driver status based on seat index 0 (first seat controls the entity) - Simplify riding logic by removing direct position manipulation - Ensure proper viewer updates when changing seats or dismounting
- Modify NextFreeSeatIndex to accept click position for context-aware seat selection - Pass clicked position from interaction data to seat selection method
TwistedAsylumMC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the direction this has gone, just a few minor comments. I assume this has been tested with the most recent changes? Would be nice to see some minimal code showing an example entity being created with seats etc.
Yep it's tested. Also where do I put the example code? |
This PR is an updated version of #330 but I made several changes according to the feedback given in that PR.
If you want to suggest changes, please let me know.