Package com.destroystokyo.paper.profile
Interface PlayerProfile
public interface PlayerProfile
Represents a players profile for the game, such as UUID, Name, and textures.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears all properties on this profiledefault boolean
complete()
If this profile is not complete, then make the API call to complete it.boolean
complete
(boolean textures) If this profile is not complete, then make the API call to complete it.boolean
complete
(boolean textures, boolean onlineMode) If this profile is not complete, then make the API call to complete it.boolean
Likecomplete(boolean)
but will try only from cache, and not make network calls Does not account for textures.boolean
completeFromCache
(boolean onlineMode) Likecomplete(boolean)
but will try only from cache, and not make network calls Does not account for textures.boolean
completeFromCache
(boolean lookupUUID, boolean onlineMode) Likecomplete(boolean)
but will try only from cache, and not make network calls Does not account for textures.getId()
getName()
boolean
hasProperty
(@Nullable String property) Check if the Profile has the specified propertydefault boolean
Whether or not this Profile has textures associated to itboolean
default boolean
removeProperties
(@NotNull Collection<ProfileProperty> properties) Removes all properties in the collectiondefault boolean
removeProperty
(@NotNull ProfileProperty property) Removes a specific property from this profileboolean
removeProperty
(@Nullable String property) Removes a specific property from this profileSets this profiles UUIDSets this profiles Namevoid
setProperties
(@NotNull Collection<ProfileProperty> properties) Sets multiple properties.void
setProperty
(@NotNull ProfileProperty property) Sets a property.
-
Method Details
-
getName
- Returns:
- The players name, if set
-
setName
Sets this profiles Name- Parameters:
name
- The new Name- Returns:
- The previous Name
-
getId
- Returns:
- The players unique identifier, if set
-
setId
Sets this profiles UUID- Parameters:
uuid
- The new UUID- Returns:
- The previous UUID
-
getProperties
- Returns:
- A Mutable set of this players properties, such as textures. Values specified here are subject to implementation details.
-
hasProperty
Check if the Profile has the specified property- Parameters:
property
- Property name to check- Returns:
- If the property is set
-
setProperty
Sets a property. If the property already exists, the previous one will be replaced- Parameters:
property
- Property to set.
-
setProperties
Sets multiple properties. If any of the set properties already exist, it will be replaced- Parameters:
properties
- The properties to set
-
removeProperty
Removes a specific property from this profile- Parameters:
property
- The property to remove- Returns:
- If a property was removed
-
removeProperty
Removes a specific property from this profile- Parameters:
property
- The property to remove- Returns:
- If a property was removed
-
removeProperties
Removes all properties in the collection- Parameters:
properties
- The properties to remove- Returns:
- If any property was removed
-
clearProperties
void clearProperties()Clears all properties on this profile -
isComplete
boolean isComplete()- Returns:
- If the profile is now complete (has UUID and Name)
-
completeFromCache
boolean completeFromCache()Likecomplete(boolean)
but will try only from cache, and not make network calls Does not account for textures.- Returns:
- If the profile is now complete (has UUID and Name)
-
completeFromCache
boolean completeFromCache(boolean onlineMode) Likecomplete(boolean)
but will try only from cache, and not make network calls Does not account for textures.- Parameters:
onlineMode
- Treat this as online mode or not- Returns:
- If the profile is now complete (has UUID and Name)
-
completeFromCache
boolean completeFromCache(boolean lookupUUID, boolean onlineMode) Likecomplete(boolean)
but will try only from cache, and not make network calls Does not account for textures.- Parameters:
lookupUUID
- If only name is supplied, should we do a UUID lookuponlineMode
- Treat this as online mode or not- Returns:
- If the profile is now complete (has UUID and Name)
-
complete
default boolean complete()If this profile is not complete, then make the API call to complete it. This is a blocking operation and should be done asynchronously. This will also complete textures. If you do not want to load textures, use {complete(boolean)
}- Returns:
- If the profile is now complete (has UUID and Name) (if you get rate limited, this operation may fail)
-
complete
boolean complete(boolean textures) If this profile is not complete, then make the API call to complete it. This is a blocking operation and should be done asynchronously. Optionally will also fill textures. Online mode will be automatically determined- Parameters:
textures
- controls if we should fill the profile with texture properties- Returns:
- If the profile is now complete (has UUID and Name) (if you get rate limited, this operation may fail)
-
complete
boolean complete(boolean textures, boolean onlineMode) If this profile is not complete, then make the API call to complete it. This is a blocking operation and should be done asynchronously. Optionally will also fill textures.- Parameters:
textures
- controls if we should fill the profile with texture propertiesonlineMode
- Treat this server as online mode or not- Returns:
- If the profile is now complete (has UUID and Name) (if you get rate limited, this operation may fail)
-
hasTextures
default boolean hasTextures()Whether or not this Profile has textures associated to it- Returns:
- If has a textures property
-