public final class GameProfile extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GameProfile.Property
Represents a Mojang profile property.
|
Constructor and Description |
---|
GameProfile(String undashedId,
String name,
List<GameProfile.Property> properties)
Creates a new Mojang game profile.
|
GameProfile(UUID id,
String name,
List<GameProfile.Property> properties)
Creates a new Mojang game profile.
|
Modifier and Type | Method and Description |
---|---|
GameProfile |
addProperties(Iterable<GameProfile.Property> properties)
Creates a new
GameProfile with the properties of this object plus the specified
properties. |
GameProfile |
addProperty(GameProfile.Property property)
Creates a new
GameProfile with the properties of this object plus the specified
property. |
static GameProfile |
forOfflinePlayer(String username)
Creates a game profile suitable for use in offline-mode.
|
UUID |
getId()
Returns the UUID associated with this game profile.
|
String |
getName()
Returns the username associated with this profile.
|
List<GameProfile.Property> |
getProperties()
Returns an immutable list of profile properties associated with this profile.
|
String |
getUndashedId()
Returns the undashed, Mojang-style UUID.
|
String |
toString() |
GameProfile |
withId(UUID id)
Creates a new
GameProfile with the specified unique id. |
GameProfile |
withName(String name)
Creates a new
GameProfile with the specified name. |
GameProfile |
withProperties(List<GameProfile.Property> properties)
Creates a new
GameProfile with the specified properties. |
GameProfile |
withUndashedId(String undashedId)
Creates a new
GameProfile with the specified undashed id. |
public GameProfile(UUID id, String name, List<GameProfile.Property> properties)
id
- the UUID for the profilename
- the profile's usernameproperties
- properties for the profilepublic GameProfile(String undashedId, String name, List<GameProfile.Property> properties)
undashedId
- the undashed, Mojang-style UUID for the profilename
- the profile's usernameproperties
- properties for the profilepublic String getUndashedId()
public UUID getId()
public String getName()
public List<GameProfile.Property> getProperties()
public GameProfile withId(UUID id)
GameProfile
with the specified unique id.id
- the new unique idGameProfile
public GameProfile withUndashedId(String undashedId)
GameProfile
with the specified undashed id.undashedId
- the new undashed idGameProfile
public GameProfile withName(String name)
GameProfile
with the specified name.name
- the new nameGameProfile
public GameProfile withProperties(List<GameProfile.Property> properties)
GameProfile
with the specified properties.properties
- the new propertiesGameProfile
public GameProfile addProperties(Iterable<GameProfile.Property> properties)
GameProfile
with the properties of this object plus the specified
properties.properties
- the properties to addGameProfile
public GameProfile addProperty(GameProfile.Property property)
GameProfile
with the properties of this object plus the specified
property.property
- the property to addGameProfile
public static GameProfile forOfflinePlayer(String username)
username
- the username to use