Interface ResolvableProfile
- All Superinterfaces:
PlayerHeadObjectContents.SkinSource
PlayerProfile
.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Builder forResolvableProfile
.static interface
Override rendering options for aResolvableProfile
.static interface
Builder forResolvableProfile.SkinPatch
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
dynamic()
Whether this resolvable profile was marked as dynamic.name()
@Unmodifiable Collection
<ProfileProperty> static ResolvableProfile.Builder
static ResolvableProfile
resolvableProfile
(PlayerProfile profile) resolve()
Produces an updated player profile based on thisResolvableProfile
, mirroring client behavior.Gets the skin patch used by the client for rendering.uuid()
Methods inherited from interface net.kyori.adventure.text.object.PlayerHeadObjectContents.SkinSource
applySkinToPlayerHeadContents
-
Method Details
-
resolvableProfile
@Contract(value="_ -> new", pure=true) static ResolvableProfile resolvableProfile(PlayerProfile profile) -
resolvableProfile
-
uuid
-
name
-
properties
-
dynamic
@Contract(pure=true) boolean dynamic()Whether this resolvable profile was marked as dynamic.A dynamic resolvable profile is required to either have a non-null
uuid()
orname()
and will be resolved by the client via a network call. A dynamic profile will also not include any properties.- Returns:
true
if this profile is marked as dynamic,false
otherwise.
-
resolve
Produces an updated player profile based on thisResolvableProfile
, mirroring client behavior.-
For
dynamic()
profiles:This tries to produce a completed profile by filling in missing properties (name, unique id, textures, etc.), and updates existing properties (e.g. name) to their official and up-to-date values. This operation does not alter the current profile, but produces a new updated
PlayerProfile
.If no player exists for the unique id or name of this profile, this operation yields a profile that is equal to the current profile, which might not be complete.
-
For static (non-
dynamic()
) profiles:Completes with a profile containing all of
properties()
exactly, and nullname()
/uuid()
replaced by filler values.
CompletableFuture
will be completed once the updated profile is available. In order to not block the server's main thread, you should not wait for the result of the returned CompletableFuture on the server's main thread. Instead, if you want to do something with the updated player profile on the server's main thread once it is available, you could do something like this:profile.resolve().thenAcceptAsync(updatedProfile -> { // Do something with the updated profile: // ... }, runnable -> Bukkit.getScheduler().runTask(plugin, runnable));
-
For
-
skinPatch
Gets the skin patch used by the client for rendering. Overrides any values resolved from the profile.- Returns:
- the skin patch
-