-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add ProtocolChangedEvent to the API #3591
base: master
Are you sure you want to change the base?
Conversation
Bump |
import net.md_5.bungee.protocol.Protocol; | ||
|
||
/** | ||
* Called when the encode or decode protocol of a {@link Connection} is changed. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
version notice for what?
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.
Uhm I was wrong, I only thought this was related to 1.20.2+ somehow
If the connection of the event is a server, I am quite sure it is impossible by API to find out to which user the server connection belongs to. |
thats right |
i'll add api for that |
do you think we could just add in Server.java? the current docs would need a change,
|
Sounds like a valid option to me, could maybe also help certain applications of Server<->Bungee plugin messages. |
I don't like getConnectedPlayer as the player can connect to another server and is not connected anymore, but the api would return the player, also returning null if the player is disconnected seems like a bad idea for me |
ProtocolChangedEvent is called when the encode or decode protocol of any Connection is changed.
We now can detect if a 1.20.4 player is changing protocol to config or play via API, but it is also possible to detect if the InitialHandler changes protocol from Handshake to Status or Login