public interface GameProfile extends Identifiable, DataSerializable
Use the UserStorageService
service to
obtain the stored data associated with a profile.
Modifier and Type | Method and Description |
---|---|
default GameProfile |
addProperty(ProfileProperty property)
Adds a profile property to this game profile.
|
default GameProfile |
addProperty(String name,
ProfileProperty property)
Adds a profile property to this game profile.
|
Optional<String> |
getName()
Gets the name associated with this profile.
|
Multimap<String,ProfileProperty> |
getPropertyMap()
Gets the property map for this profile.
|
boolean |
isFilled()
Checks if this profile is filled.
|
static GameProfile |
of(UUID uniqueId)
Creates a
GameProfile from the provided ID. |
static GameProfile |
of(UUID uniqueId,
String name)
Creates a
GameProfile from the provided ID and name. |
default boolean |
removeProperty(ProfileProperty property)
Removes a profile property to this game profile.
|
default boolean |
removeProperty(String name,
ProfileProperty property)
Removes a profile property to this game profile.
|
getUniqueId
getContentVersion, toContainer
static GameProfile of(UUID uniqueId)
GameProfile
from the provided ID.
The name of the created profile will be null
.
uniqueId
- The unique idstatic GameProfile of(UUID uniqueId, @Nullable String name)
GameProfile
from the provided ID and name.uniqueId
- The unique idname
- The nameOptional<String> getName()
Optional.empty()
Multimap<String,ProfileProperty> getPropertyMap()
This is a mutable map.
default GameProfile addProperty(ProfileProperty property)
The name
of the property is used when
adding the profile property to the property map
.
property
- The profile propertydefault GameProfile addProperty(String name, ProfileProperty property)
name
- The name of the propertyproperty
- The profile propertydefault boolean removeProperty(ProfileProperty property)
The name
of the property is used when
removing the profile property from the property map
.
property
- The profile propertytrue
if the property map changeddefault boolean removeProperty(String name, ProfileProperty property)
name
- The name of the propertyproperty
- The profile propertytrue
if the property map changedboolean isFilled()
A filled profile contains both a unique id and name.
true
if this profile is filledGameProfileManager.fill(GameProfile)
,
GameProfileManager.fill(GameProfile, boolean)
,
GameProfileManager.fill(GameProfile, boolean, boolean)