Handle offline mode in the tab list
This commit is contained in:
parent
c822c48fef
commit
1f132876e6
@ -70,6 +70,8 @@ public class Global extends TabList
|
||||
item.setUsername( p.getName() );
|
||||
item.setDisplayName( ComponentSerializer.toString( TextComponent.fromLegacyText( p.getDisplayName() ) ) );
|
||||
LoginResult loginResult = ( (UserConnection) p ).getPendingConnection().getLoginProfile();
|
||||
if ( loginResult != null )
|
||||
{
|
||||
String[][] props = new String[ loginResult.getProperties().length ][];
|
||||
for ( int j = 0; j < props.length; j++ )
|
||||
{
|
||||
@ -81,6 +83,10 @@ public class Global extends TabList
|
||||
};
|
||||
}
|
||||
item.setProperties( props );
|
||||
} else
|
||||
{
|
||||
item.setProperties( new String[0][0] );
|
||||
}
|
||||
item.setGamemode( ( (UserConnection) p ).getGamemode() );
|
||||
item.setPing( p.getPing() );
|
||||
}
|
||||
|
@ -36,6 +36,8 @@ public abstract class TabList
|
||||
{
|
||||
item.setUuid( player.getUniqueId() );
|
||||
LoginResult loginResult = player.getPendingConnection().getLoginProfile();
|
||||
if ( loginResult != null )
|
||||
{
|
||||
String[][] props = new String[ loginResult.getProperties().length ][];
|
||||
for ( int i = 0; i < props.length; i++ )
|
||||
{
|
||||
@ -47,6 +49,10 @@ public abstract class TabList
|
||||
};
|
||||
}
|
||||
item.setProperties( props );
|
||||
} else
|
||||
{
|
||||
item.setProperties( new String[ 0 ][ 0 ] );
|
||||
}
|
||||
if ( playerListItem.getAction() == PlayerListItem.Action.ADD_PLAYER || playerListItem.getAction() == PlayerListItem.Action.UPDATE_GAMEMODE )
|
||||
{
|
||||
player.setGamemode( item.getGamemode() );
|
||||
|
Loading…
Reference in New Issue
Block a user