Overview
TheModelProfile interface represents a model’s skin profile, containing player information and skin data. It provides methods for creating, retrieving, and managing player profiles both synchronously and asynchronously.
Interface Definition
Constants
UNKNOWN
Core Methods
info()
Gets the profile information.skin()
Gets the skin data.player()
Gets the online player associated with this profile.asUncompleted()
Converts this profile to an uncompleted profile for async operations.Static Factory Methods
of(ModelProfileInfo)
Creates a profile with the given information and empty skin.info- The profile information
of(ModelProfileInfo, ModelProfileSkin)
Creates a profile with the given information and skin.info- The profile informationskin- The skin data
of(PlatformPlayer)
Gets the profile for an online player.player- The online player
of(PlatformOfflinePlayer)
Gets an uncompleted profile for an offline player.offlinePlayer- The offline player
of(UUID)
Gets an uncompleted profile by player UUID.uuid- The player’s UUID
Nested Types
Simple
A simple record implementation of ModelProfile.Uncompleted
Represents a profile that needs to be completed asynchronously, typically for offline players or delayed skin fetching.Methods
info() - Gets the available profile information complete() - Asynchronously completes the profile by fetching skin data fallback() - Returns a fallback profile without waiting for completionUsage Examples
Basic Profile Creation
Async Profile Loading
Creating Custom Profiles
Checking Player Status
Working with Unknown Profiles
Profile Resolution Flow
- Online Player:
ModelProfile.of(PlatformPlayer)returns immediate profile with full data - Offline Player:
ModelProfile.of(UUID)returnsUncompletedprofile - Fallback: Call
fallback()for immediate partial data - Complete: Call
complete()for async full profile fetch - Unknown: Use
ModelProfile.UNKNOWNwhen no data is available
Thread Safety
Profile operations are designed to be thread-safe:- Synchronous methods (
of(PlatformPlayer)) are safe for main thread - Async methods (
complete()) handle profile fetching on background threads - The
Uncompletedinterface provides both immediate and async access patterns
See Also
- ModelProfileInfo - Profile information structure
- ModelProfileSkin - Skin texture data
- PlatformPlayer - Platform player abstraction
