Interface AvatarSource
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Fetches a player's face as PNG bytes, given a UUID.
Optional, and it has a default. Without one wired, the library resolves the skin from Mojang's own session server and crops the face itself, which keeps every alt's identity between the host and Mojang — the two parties already talking during login — rather than disclosing it to a third-party head-render service on every cache miss.
A host that wants a head-render service back, for its 3D renders or its CDN, sets
AltsRuntime.Builder#avatarUrlTemplate(String), or implements this seam itself. That is a deliberate choice a host makes,
not the default it gets by doing nothing.
- Since:
- 0.10.0
-
Method Summary
-
Method Details
-
avatarPng
Returns the face foruuidas PNG bytes at roughlysizePxsquare.The size is a hint. A source is free to return the closest it has and let the host scale; the cache does not require an exact match.
- Parameters:
uuid- the dashed or undashed player UUIDsizePx- the desired face size in pixels- Returns:
- the PNG bytes, or
nullwhen the face could not be produced - Throws:
Exception- if the fetch failed in a way worth retrying- Since:
- 0.10.0
-