PlayerNames Bukkit plugin and API
Minecraft has (apparently) made plans for supporting username changes for a while. While this change is going to make a lot of the Minecraft community's life easier, it really is a big pain in the ass for developers, I'll talk a little more about this later. Sk89q made a great post about this which you can find here.
I personally think this system could have been done better by replacing UUIDs with account names which the user will pick themselves. Of course those account names would be unique just like the current 1.7 and older version usernames are. I'm not entirely sure why Minecraft didn't implement it like this, but I'm hoping they have a good reason. With the UUID change, life is really going to be hard for developers.
Lets say you are in-game, and trying to check out when John was last seen on the server, You would type something like /seen John, but what if John decided to change his name to JohnDoe and you weren't aware of the change. The plugin would most likely throw an error saying that John never joined the server before. This would happen even if the plugin only stored John's UUID and not his recent name changes (which is what a lot of plugins are doing). Of course, memorising John's UUID is close to impossible (unless you wrote it down somewhere), so referring to players using their UUID is not an option.
For a long time now I've been wanting to contribute something to the Bukkit community since they really deserve it. So, two days ago while in a Skype conversation, someone brought up UUIDs and I've really had enough of people suffering from the UUID change, even though everyone had 8+ months to come up with a solution. At that point in, I didn't get a chance to think of a solution, the idea just came to me.
So, I made a Bukkit plugin called PlayerNames. Simply put, PlayerNames keeps track of names that players logged on to the server with. If another player joins the server with a name that a player previously used, it changes the name owner to the new player.
The plugin supports two types of databases, YAML (Flatfile) and MySQL. I have plans for custom database implementation. It's extremely easy to use. You should only be concerned about one Java Class and that is PlayerNamesAPI. PlayerNamesAPI contains only static methods for easy access to the database.
The problem with this implementation is, if you type /seen John and John changes his name to JohnDoe, then Rick changes their name to John and joins the server, then it will think you are referring to Rick instead of John which can really be annoying.
As I said before, this idea came to me (which really makes me happy), so I didn't get a chance to rethink it. I'm sure there are better ways to go about this, but I really like my current implementation.
Enough chit-chat: Here's the source code. I can't be bothered to put up a jar download since I don't have Jenkins installed, but if I get bothered about it, I'll be sure to set something up.
Thank you for taking the time out of your day to read my post, please leave a comment below. :)