As a personal feature in my plugin I'm trying to include a command that will let my change my user name so I can log in twice. However, I've tried changing the name, display name, list name and even UUID but it still glitches up whenever I log in with a second client. Does anybody know how to get around this issue? Hacky fixes are ok because this isn't a real command in my plugin, its just to help me debug issues that require 2 players so it wont matter if it breaks with every update.
If you're just doing this to debug your plugin: Put your server into offline mode. But before you do that, be very sure it's not publicly accessible. Use non-routable address space, firewall your PC, add a whitelist ... In the minecraft client, attempt to log in with a bad password, and click "Play Offline" when you get the option. You can then log into your offline-mode server as "Player". That should be enough for testing purposes. No client hackery needed.
What is wrong with putting a local hosted server that you are the only one that uses in offline mode?
Well yeah I could do the offline trick but I was hoping to find a code solution so that I wouldn't have to deal with switching between online and offline mode. I mean, this problem is probably just a single variable or object I need to change/update, it's just a matter of where it is within bukkit. By hacky fixes I meant less than ideal coding =p
Why would one have a public server for testing your plugins? I keep mine local just because I want to be able to turn it off all the time if something goes haywire, not have to deal with other players, etc
Simple solution is run two launchers on your machine; one logged in, other offline. I am certain there is no code in bukkit that allows multiple connections from the same player, as this is hard coded into minecraft to not work.
That is true, but if you change the players name after they log in it bypasses that limitation. However, the name is still stored in some obscure part of bukkit which causes glitches whenever I log in from the second client. I don't get kicked, but it gets confused and thinks both players are the same despite the changed name. I've been searching through the code for where the issue might be and the closest I've come has been the players list in CraftEntity. It stores the players name connected to the player object but I couldn't figure out how to update the list for the new name. My mod does a lot of stuff that requires 2 players to test, such as riding other players, teleporting to them, pvp stuff, etc.