Use player name casing from LoginResult

This commit is contained in:
BlackHole 2017-05-08 21:55:02 +02:00 committed by md_5
parent 806a6dfaca
commit 5bc189fbb7
2 changed files with 4 additions and 1 deletions

View File

@ -92,6 +92,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
private boolean onlineMode = BungeeCord.getInstance().config.isOnlineMode(); private boolean onlineMode = BungeeCord.getInstance().config.isOnlineMode();
@Getter @Getter
private InetSocketAddress virtualHost; private InetSocketAddress virtualHost;
private String name;
@Getter @Getter
private UUID uniqueId; private UUID uniqueId;
@Getter @Getter
@ -419,6 +420,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
if ( obj != null && obj.getId() != null ) if ( obj != null && obj.getId() != null )
{ {
loginProfile = obj; loginProfile = obj;
name = obj.getName();
uniqueId = Util.getUUID( obj.getId() ); uniqueId = Util.getUUID( obj.getId() );
finish(); finish();
return; return;
@ -560,7 +562,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@Override @Override
public String getName() public String getName()
{ {
return ( loginRequest == null ) ? null : loginRequest.getData(); return (name != null ) ? name : ( loginRequest == null ) ? null : loginRequest.getData();
} }
@Override @Override

View File

@ -9,6 +9,7 @@ public class LoginResult
{ {
private String id; private String id;
private String name;
private Property[] properties; private Property[] properties;
@Data @Data