-
Notifications
You must be signed in to change notification settings - Fork 144
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
Implement entity riding #330
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for your PR! I've got a couple of comments. It might also be desirable to have a mount/dismount event handler in player/handler.go.
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.
Looking pretty good! My last comments are to add mount/dismount handlers in the player.Handler that are cancellable. Should be good to go after that if it's all been tested.
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.
Got some last comments just to clean up some of the world.Entity vs entity.Rideable. Should be good to go once you resolve those.
So most of this PR looks good now, I just have one concern, which is |
I'm not sure how I would change that other than making the method names and descriptions more specific. The player needs to contain some sort of function to send packets to link entities as well as store the entity that it is mounted to. The entity needs to store all of the currently mounted players. I can't move most of the functionality into either method because it's specific to the scope of each interface. If you have any better ideas I'd be willing to try them out, but as far as I can tell this implementation works the best. |
# Conflicts: # server/player/player.go
Any update on this? |
As Sander suggested on Discord, a good alternative is probably some sort of |
Entities with the ability to ride other entities implement the Rider interface
Entities with the ability to be ridden implement the Rideable interface
Player implements the Rider interface
I've tested all of these changes