Fix uniqueId returning null in LoginEvent

This commit is contained in:
Isaias 2014-07-04 15:17:27 -03:00 committed by Thinkofdeath
parent fc0a21f548
commit c42d3a375f

View File

@ -355,6 +355,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection
old.disconnect( bungee.getTranslation( "already_connected" ) ); old.disconnect( bungee.getTranslation( "already_connected" ) );
} }
offlineId = java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + getName() ).getBytes( Charsets.UTF_8 ) );
if ( uniqueId == null )
{
uniqueId = offlineId;
}
Callback<LoginEvent> complete = new Callback<LoginEvent>() Callback<LoginEvent> complete = new Callback<LoginEvent>()
{ {
@Override @Override
@ -377,12 +383,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection
{ {
if ( ch.getHandle().isActive() ) if ( ch.getHandle().isActive() )
{ {
offlineId = java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + getName() ).getBytes( Charsets.UTF_8 ) );
if ( uniqueId == null )
{
uniqueId = offlineId;
}
if ( getVersion() >= ProtocolConstants.MINECRAFT_1_7_6 ) if ( getVersion() >= ProtocolConstants.MINECRAFT_1_7_6 )
{ {
unsafe.sendPacket( new LoginSuccess( getUniqueId().toString(), getName() ) ); // With dashes in between unsafe.sendPacket( new LoginSuccess( getUniqueId().toString(), getName() ) ); // With dashes in between