Interface GameProfile

All Superinterfaces:
DataSerializable, net.kyori.examination.Examinable, Identifiable, Identity

public interface GameProfile extends Identifiable, Identity, DataSerializable
Represents a profile of a user.

Use the UserManager service to obtain the stored data associated with a profile.

  • Method Details

    • of

      static GameProfile of(UUID uniqueId)
      Creates a GameProfile from the provided ID.

      The name of the created profile will be null.

      Parameters:
      uniqueId - The unique id
      Returns:
      The created profile
    • of

      static GameProfile of(UUID uniqueId, @Nullable String name)
      Creates a GameProfile from the provided ID and name.
      Parameters:
      uniqueId - The unique id
      name - The name
      Returns:
      The created profile
    • uuid

      default UUID uuid()
      Specified by:
      uuid in interface Identity
    • name

      Optional<String> 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

      GameProfile withName(@Nullable String name)
      Gets a new GameProfile with 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 new GameProfile with the same name and unique id of this profile, but without any of the properties.
      Returns:
      The new game profile
    • withProperties

      GameProfile withProperties(Iterable<ProfileProperty> properties)
      Gets a new GameProfile with the given properties added to its properties.
      Parameters:
      properties - The profile properties to add
      Returns:
      The new game profile
    • withProperty

      GameProfile withProperty(ProfileProperty property)
      Gets a new GameProfile with the given property added to its properties.
      Parameters:
      property - The profile property to add
      Returns:
      The new game profile
    • withoutProperties

      GameProfile withoutProperties(Iterable<ProfileProperty> properties)
      Gets a new GameProfile with the given property removed from to its properties.
      Parameters:
      properties - The profile properties to remove
      Returns:
      The new game profile
    • withoutProperties

      default GameProfile withoutProperties(String name)
      Gets a new GameProfile where 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

      GameProfile withoutProperty(ProfileProperty property)
      Gets a new GameProfile with the given property removed from its properties.
      Parameters:
      property - The profile property to remove
      Returns:
      The new game profile
    • withoutProperties

      GameProfile withoutProperties(Predicate<ProfileProperty> filter)
      Gets a new GameProfile with where the properties that match the given filter are removed.
      Parameters:
      filter - The profile property filter
      Returns:
      The new game profile