TheUnnamedDude/BungeeCord — pull request #2 by xxyy (2013-11-19 23:14:21+00:00)
Title: Implement proper ProxyPingEvent for 1.7.2

This pull request adds a __proper ProxyPingEvent for 1.7.2 pings__ by adding a new class NewServerPing, which is used to represent a 1.7.2 equivalent of ServerPing. I have moved the Json logic there for readability.
I have also modified the ProxyPingEvent to provide a boolean stating if the new protocol is used and providing a NewServerPing. To maintain compatibility with 1.6.4 Bungee plugins, the NewServerPing is converted to the 1.6.4 ServerPing in the constructor if it's a 1.7.2 event. If it's a 1.6.4 event, only the ServerPing is created. If a 1.6.4 plugin sets the response for a 1.7.2 event, the NewServerPing is updated.

Should be 100% compatible with 1.6.4 plugins!

This adds a google json dependency to api, adds a new Class NewServerPing to represent 1.7.2 ping responses, adds a method to ServerPing to convert into a NewServerPing object, moves json creation form InitialHandler to NewServerPing, adds event compatibility for 1.7.2 pings.

I have tested it, BungeeCord compiles and runs, my test plugin worked just fine and as intended.

I have not provided any more material as this repo does not contain a CONTRIBUTUING.md at the moment, but can adapt. (Especially names - It might be more accurate to name NewServerPing 172ServerPing, but this looks ugly :D)

Thanks for considering it.