LilyPad/GoLilyPad — pull request #12 by flaminscotsman (2014-08-14 20:13:19+00:00)
Title: Add basic plugin channel handling

Tracks plugin channel registrations/deregistrations and re-registers all tracked channels when a player is redirected to a new server. Aims to emulate bungeecord handling of plugin channels as currently liteloader mods do not resend their channel registrations on server redirect.

[Bungeecord](https://github.com/SpigotMC/BungeeCord/blob/master/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java#L115) caps the number of cached plugin channel packets at 128, although they allow duplicate channel registrations and don't handle deregistrations.

This implementation removes duplicate channels, and sends all channel registrations as a single null-delimited string. Use shows channel registrations and deduplication function as expected, although none of used client mods send channel deregistrations, so have been unable to test that.