Package com.velocitypowered.api.util
Class GameProfile
java.lang.Object
com.velocitypowered.api.util.GameProfile
Represents a Mojang game profile. This class is immutable.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Represents a Mojang profile property. -
Constructor Summary
ConstructorDescriptionGameProfile
(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. -
Method Summary
Modifier and TypeMethodDescriptionaddProperties
(Iterable<GameProfile.Property> properties) Creates a newGameProfile
with the properties of this object plus the specified properties.addProperty
(GameProfile.Property property) Creates a newGameProfile
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.getId()
Returns the UUID associated with this game profile.getName()
Returns the username associated with this profile.Returns an immutable list of profile properties associated with this profile.Returns the undashed, Mojang-style UUID.toString()
Creates a newGameProfile
with the specified unique id.Creates a newGameProfile
with the specified name.withProperties
(List<GameProfile.Property> properties) Creates a newGameProfile
with the specified properties.withUndashedId
(String undashedId) Creates a newGameProfile
with the specified undashed id.
-
Constructor Details
-
GameProfile
Creates a new Mojang game profile.- Parameters:
id
- the UUID for the profilename
- the profile's usernameproperties
- properties for the profile
-
GameProfile
Creates a new Mojang game profile.- Parameters:
undashedId
- the undashed, Mojang-style UUID for the profilename
- the profile's usernameproperties
- properties for the profile
-
-
Method Details
-
getUndashedId
Returns the undashed, Mojang-style UUID.- Returns:
- the undashed UUID
-
getId
Returns the UUID associated with this game profile.- Returns:
- the UUID
-
getName
Returns the username associated with this profile.- Returns:
- the username
-
getProperties
Returns an immutable list of profile properties associated with this profile.- Returns:
- the properties associated with this profile
-
withId
Creates a newGameProfile
with the specified unique id.- Parameters:
id
- the new unique id- Returns:
- the new
GameProfile
-
withUndashedId
Creates a newGameProfile
with the specified undashed id.- Parameters:
undashedId
- the new undashed id- Returns:
- the new
GameProfile
-
withName
Creates a newGameProfile
with the specified name.- Parameters:
name
- the new name- Returns:
- the new
GameProfile
-
withProperties
Creates a newGameProfile
with the specified properties.- Parameters:
properties
- the new properties- Returns:
- the new
GameProfile
-
addProperties
Creates a newGameProfile
with the properties of this object plus the specified properties.- Parameters:
properties
- the properties to add- Returns:
- the new
GameProfile
-
addProperty
Creates a newGameProfile
with the properties of this object plus the specified property.- Parameters:
property
- the property to add- Returns:
- the new
GameProfile
-
forOfflinePlayer
Creates a game profile suitable for use in offline-mode.- Parameters:
username
- the username to use- Returns:
- the new offline-mode game profile
-
toString
-