Ultimately this PR was selected as it better matched the existing code in terms of using lombok and not adding incomplete interfacing.
If for some reason a common interface is required, this can be implemented later.
Thanks to yawkat also for the PR in #1336 -- it was difficult for the merger to compromise between this and #1957
* Only double switch if the dimension is the same.
According to the protocol, a double respawn packet is only needed to be
sent if from the same dimension, so by storing the last known dimension,
we are able to compare and avoid the double packet.
This also maintains the same behaviour for Spigot
ad2f806097
* Store current dimension on first disconnect too
According to the protocol, a double respawn packet is only needed to be
sent if from the same dimension, so by storing the last known dimension,
we are able to compare and avoid the double packet.
This also maintains the same behaviour for Spigot
ad2f806097
If the client protocol version is not supported, show outdated_server message only if client version is higher than highest supported protocol version, outdated_client message else.
If the list would look like this
- test1 -> 1.8 -> ServerKickEvent cancelled -> reason set to "outdated"
- test2 -> 1.8
- test3 -> 1.9
and a player joins with version 1.8 he would never be connected to test2 because the server test2 is not equal to test1 and the server test3 is not equal to test1.
So test3 is the last in the while loop and would be used also if another server with higher priority matches the requirements.
Action Bar packets in 1.9 now correctly support the JSON format, however sending them the 1.8 way will kick the client. This keeps the compatibility with 1.8 clients with the version check whilst correctly sending the packet to 1.9 clients.