Package org.geysermc.mcprotocollib.auth
Class GameProfile
java.lang.Object
org.geysermc.mcprotocollib.auth.GameProfile
Information about a user profile.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA property belonging to a profile.static classA texture contained within a profile.static enumThe model used for a profile texture.static enumThe type of a profile texture. -
Constructor Summary
ConstructorsConstructorDescriptionGameProfile(String id, String name) Creates a new GameProfile instance.GameProfile(UUID id, String name) Creates a new GameProfile instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetId()Gets the ID of the profile.Gets the ID of the profile as a String.getName()Gets the name of the profile.Gets an immutable list of properties contained in the profile.getProperty(String name) Gets a property contained in the profile.Gets a texture contained in the profile.getTexture(GameProfile.TextureType type, boolean requireSecure) Gets a texture contained in the profile.Gets an immutable map of texture types to textures contained in the profile.getTextures(boolean requireSecure) Gets an immutable map of texture types to textures contained in the profile.inthashCode()booleanGets whether the profile is complete.voidsetProperties(List<GameProfile.Property> properties) Sets the properties of this profile.toString()
-
Constructor Details
-
GameProfile
Creates a new GameProfile instance.- Parameters:
id- ID of the profile.name- Name of the profile.
-
GameProfile
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
Gets the ID of the profile.- Returns:
- The profile's ID.
-
getIdAsString
Gets the ID of the profile as a String.- Returns:
- The profile's ID as a string.
-
getName
Gets the name of the profile.- Returns:
- The profile's name.
-
getProperties
Gets an immutable list of properties contained in the profile.- Returns:
- The profile's properties.
-
setProperties
Sets the properties of this profile.- Parameters:
properties- Properties belonging to this profile.
-
getProperty
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
-
hashCode
public int hashCode() -
toString
-