Package org.spongepowered.api.profile
Interface GameProfile
- All Superinterfaces:
DataSerializable,net.kyori.examination.Examinable,Identifiable,Identity
Represents a profile of a user.
Use the UserManager service to
obtain the stored data associated with a profile.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface net.kyori.adventure.identity.Identity
DISPLAY_NAME, LOCALE, NAME, UUID -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanhasName()Gets whether this game profile has a known name.name()Gets the name associated with this profile.static GameProfileCreates aGameProfilefrom the provided ID.static GameProfileCreates aGameProfilefrom the provided ID and name.Gets an immutable list of all the properties in this game profile.default UUIDuuid()Gets a newGameProfilewith the given name.Gets a newGameProfilewith the same name and unique id of this profile, but without any of the properties.withoutProperties(Iterable<ProfileProperty> properties) Gets a newGameProfilewith the given property removed from to its properties.default GameProfilewithoutProperties(String name) Gets a newGameProfilewhere the properties which have the given name are removed from its properties.withoutProperties(Predicate<ProfileProperty> filter) Gets a newGameProfilewith where the properties that match the given filter are removed.withoutProperty(ProfileProperty property) Gets a newGameProfilewith the given property removed from its properties.withProperties(Iterable<ProfileProperty> properties) Gets a newGameProfilewith the given properties added to its properties.withProperty(ProfileProperty property) Gets a newGameProfilewith the given property added to its properties.Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainerMethods inherited from interface net.kyori.examination.Examinable
examinableName, examineMethods inherited from interface org.spongepowered.api.util.Identifiable
uniqueIdMethods inherited from interface net.kyori.adventure.identity.Identity
examinableProperties
-
Method Details
-
of
Creates aGameProfilefrom the provided ID.The name of the created profile will be
null.- Parameters:
uniqueId- The unique id- Returns:
- The created profile
-
of
Creates aGameProfilefrom the provided ID and name.- Parameters:
uniqueId- The unique idname- The name- Returns:
- The created profile
-
uuid
-
name
Gets the name associated with this profile.- Returns:
- The associated name if present, otherwise
Optional.empty()
-
hasName
default boolean hasName()Gets whether this game profile has a known name.- Returns:
- Whether the name is known
-
withName
Gets a newGameProfilewith the given name.- Parameters:
name- The name- Returns:
- The new game profile
-
properties
List<ProfileProperty> properties()Gets an immutable list of all the properties in this game profile.- Returns:
- The properties
-
withoutProperties
GameProfile withoutProperties()Gets a newGameProfilewith the same name and unique id of this profile, but without any of the properties.- Returns:
- The new game profile
-
withProperties
Gets a newGameProfilewith the given properties added to its properties.- Parameters:
properties- The profile properties to add- Returns:
- The new game profile
-
withProperty
Gets a newGameProfilewith the given property added to its properties.- Parameters:
property- The profile property to add- Returns:
- The new game profile
-
withoutProperties
Gets a newGameProfilewith the given property removed from to its properties.- Parameters:
properties- The profile properties to remove- Returns:
- The new game profile
-
withoutProperties
Gets a newGameProfilewhere the properties which have the given name are removed from its properties.- Parameters:
name- The profile property name to remove- Returns:
- The new game profile
-
withoutProperty
Gets a newGameProfilewith the given property removed from its properties.- Parameters:
property- The profile property to remove- Returns:
- The new game profile
-
withoutProperties
Gets a newGameProfilewith where the properties that match the given filter are removed.- Parameters:
filter- The profile property filter- Returns:
- The new game profile
-