Fixes #1686: Let PlayerRegistry handle nonexistent players

This commit is contained in:
yueh
2015-07-06 16:44:36 +02:00
committed by thatsIch
parent 37f51db0d9
commit 33e2eb5a74
2 changed files with 9 additions and 8 deletions
@@ -34,13 +34,18 @@ public class PlayerRegistry implements IPlayerRegistry
@Override
public int getID( GameProfile username )
{
if( username == null || !username.isComplete() )
{
return -1;
}
return WorldData.instance().playerData().getPlayerID( username );
}
@Override
public int getID( EntityPlayer player )
{
return WorldData.instance().playerData().getPlayerID( player.getGameProfile() );
return this.getID( player.getGameProfile() );
}
@Nullable