Class GameProfile

java.lang.Object
org.geysermc.mcprotocollib.auth.GameProfile

public class GameProfile extends Object
Information about a user profile.
  • Constructor Details

    • GameProfile

      public GameProfile(String id, String name)
      Creates a new GameProfile instance.
      Parameters:
      id - ID of the profile.
      name - Name of the profile.
    • GameProfile

      public GameProfile(UUID id, String name)
      Creates a new GameProfile instance.
      Parameters:
      id - ID of the profile.
      name - Name of the profile.
  • Method Details

    • isComplete

      public boolean isComplete()
      Gets whether the profile is complete.
      Returns:
      Whether the profile is complete.
    • getId

      public UUID getId()
      Gets the ID of the profile.
      Returns:
      The profile's ID.
    • getIdAsString

      public String getIdAsString()
      Gets the ID of the profile as a String.
      Returns:
      The profile's ID as a string.
    • getName

      public String getName()
      Gets the name of the profile.
      Returns:
      The profile's name.
    • getProperties

      public List<GameProfile.Property> getProperties()
      Gets an immutable list of properties contained in the profile.
      Returns:
      The profile's properties.
    • setProperties

      public void setProperties(List<GameProfile.Property> properties)
      Sets the properties of this profile.
      Parameters:
      properties - Properties belonging to this profile.
    • getProperty

      public GameProfile.Property getProperty(String name)
      Gets a property contained in the profile.
      Parameters:
      name - Name of the property.
      Returns:
      The property with the specified name.
    • getTextures

      Gets an immutable map of texture types to textures contained in the profile.
      Returns:
      The profile's textures.
      Throws:
      IllegalStateException - If an error occurs decoding the profile's texture property.
    • getTextures

      public Map<GameProfile.TextureType,GameProfile.Texture> getTextures(boolean requireSecure) throws IllegalStateException
      Gets an immutable map of texture types to textures contained in the profile.
      Parameters:
      requireSecure - Whether to require the profile's texture payload to be securely signed.
      Returns:
      The profile's textures.
      Throws:
      IllegalStateException - If an error occurs decoding the profile's texture property.
    • getTexture

      Gets a texture contained in the profile.
      Parameters:
      type - Type of texture to get.
      Returns:
      The texture of the specified type.
      Throws:
      IllegalStateException - If an error occurs decoding the profile's texture property.
    • getTexture

      public GameProfile.Texture getTexture(GameProfile.TextureType type, boolean requireSecure) throws IllegalStateException
      Gets a texture contained in the profile.
      Parameters:
      type - Type of texture to get.
      requireSecure - Whether to require the profile's texture payload to be securely signed.
      Returns:
      The texture of the specified type.
      Throws:
      IllegalStateException - If an error occurs decoding the profile's texture property.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object