Bukkit/CraftBukkit — pull request #1294 by nightpool (2013-12-12 04:19:15+00:00)
Title: [B+C] Add player sample to the returned server info packet. Fixes BUKKIT-5121.

##### The Issue:
Hovering over the the amount of players online in the server list does not display the message which shows players currently logged into the server.

##### Justification for this PR:
This pull request fixes an issue where CraftBukkit lacks something the vanilla server does, and adds a hook for plugins to customize the list returned.

##### PR Breakdown:
The added code retrieves the random array of GameProfiles (player names+UUIDs) generated by the server, turns it into a list of Players to be passed to the event, and after the event retrieves the list of Players and turns it back into an array of GameProfiles to be added to the Server Ping object. I chose to use a list of Players rather then a list of Strings to a) make it easier to add in the UUIDs later and b) be convenient to plugins that wish to test against other Player objects, such as a list of players the don't want to show up in the sample list.

This PR is accompanied by a companion Bukkit PR.

##### Testing Results and Materials:
Tested with small plugin that removes from the player list people who request it. Everything works as expected.
https://gist.github.com/nightpool/7922846

##### Bukkit PR:
B-TDB - https://github.com/Bukkit/Bukkit/pull/TDB

##### JIRA Ticket:
BUKKIT-5121 - https://bukkit.atlassian.net/browse/BUKKIT-5121