Player Profile Deserializer
A custom deserializer for converting JSON data into a PlayerProfile
object.
This class implements JsonDeserializer<PlayerProfile>
and provides functionality to parse player profile data, including details such as UUID, name, skin URL, cape URL, and skin model type, from the Mojang session server JSON response.
The deserialization process includes:
Parsing the raw profile data (
RawPlayerProfile
) to extract basic player information.Decoding and parsing Base64-encoded textures from the profile's property list.
Extracting texture URLs for skin and cape as well as determining the player's skin model.
In case of errors during the decoding or parsing of textures, default values are used.
Functions
Link copied to clipboard
open override fun deserialize(json: JsonElement, typeOfT: Type, context: JsonDeserializationContext): PlayerProfile