-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
Improve event values move events #4895
Improve event values move events #4895
Conversation
Add future and default location event value for PlayerMoveEvent Add past, default and future event value for EntityMoveEvent
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.
LGTM. Just a question, why is PlayerMoveEvent getFrom() at time -1
and getTo() at time 0
while EntityMoveEvent getFrom() at time 0
and getTo() at time 1
?
The difference between these things determines which will be the default. If they're -1 and 0, the default is the future state, and if they're 0 and 1, the default is the past state. For PlayerMoveEvent, I chose the default to be the future state, because if you cancel a move event, the client sees it as being teleported back after moving instead of actually not moving. This means, to the client, the player has moved already so their location is updated already. If you think it's more practically useful the other way around, lmk (for example, I don't know how the server handles it internally, what the actual For EntityMoveEvent, I chose the default to be the past state, again due to the cancellation stuff. When I tried pushing the entity, they just didn't move at all, therefore I think it makes more sense to have the previous location as default. |
Cool! your choice fits the situation IMO. |
Description
Change PlayerTeleportEvent location event value to include PlayerMoveEvent (first extends the latter)
Add PlayerMoveEvent default and future location event value
Add EntityMoveEvent location event values
Also added more specific event classes to EvtMove
Target Minecraft Versions: partially Paper 1.16+
Requirements: none
Related Issues: #4890