Class WrappedGameProfile
-
Field Summary
FieldsFields inherited from class com.comphenix.protocol.wrappers.AbstractWrapper
handle, handleType -
Constructor Summary
ConstructorsConstructorDescriptionWrappedGameProfile(String id, String name) Deprecated.WrappedGameProfile(UUID uuid, String name) Construct a new game profile with the given properties. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic WrappedGameProfilefromHandle(Object handle) Construct a wrapper around an existing game profile.static WrappedGameProfilefromOfflinePlayer(org.bukkit.OfflinePlayer player) Retrieve the associated game profile of an offline player.static WrappedGameProfilefromPlayer(org.bukkit.entity.Player player) Retrieve the associated game profile of a player.getId()Retrieve the textual representation of the player's UUID.getName()Retrieve the name of the player.com.google.common.collect.Multimap<String, WrappedSignedProperty> Retrieve the property map of signed values.getUUID()Retrieve the UUID of the player.inthashCode()booleanDetermine if the game profile contains both an UUID and a name.toString()Construct a new game profile with the same name, but different id.Construct a new game profile with the same ID, but different name.Methods inherited from class com.comphenix.protocol.wrappers.AbstractWrapper
getHandle, getHandleType, setHandle
-
Field Details
-
REPORT_INVALID_UUID
-
-
Constructor Details
-
WrappedGameProfile
Deprecated.Construct a new game profile with the given properties.Note that this constructor is very lenient when parsing UUIDs for backwards compatibility reasons. IDs that cannot be parsed as an UUID will be hashed and form a version 3 UUID instead.
This method is deprecated for Minecraft 1.7.8 and above.
- Parameters:
id- - the UUID of the player.name- - the name of the player.
-
WrappedGameProfile
Construct a new game profile with the given properties.Note that at least one of the parameters must be non-null.
- Parameters:
uuid- - the UUID of the player, or NULL.name- - the name of the player, or NULL.
-
-
Method Details
-
fromPlayer
Retrieve the associated game profile of a player.Note that this may not exist in the current Minecraft version.
- Parameters:
player- - the player.- Returns:
- The game profile.
-
fromOfflinePlayer
Retrieve the associated game profile of an offline player.Note that this may not exist in the current Minecraft version.
- Parameters:
player- - the offline player.- Returns:
- The game profile.
-
fromHandle
Construct a wrapper around an existing game profile.- Parameters:
handle- - the underlying profile, or NULL.- Returns:
- A wrapper around an existing game profile.
-
getUUID
Retrieve the UUID of the player.Note that Minecraft 1.7.5 and earlier doesn't use UUIDs internally, and it may not be possible to convert the string to an UUID.
We use the same lax conversion as in
WrappedGameProfile(String, String).- Returns:
- The UUID, or NULL if the UUID is NULL.
- Throws:
IllegalStateException- If we cannot parse the internal ID as an UUID.
-
getId
Retrieve the textual representation of the player's UUID.Note that there's nothing stopping plugins from creating non-standard UUIDs.
In Minecraft 1.7.8 and later, this simply returns the string form of
getUUID().- Returns:
- The UUID of the player, or NULL if not computed.
-
getName
Retrieve the name of the player.- Returns:
- The player name.
-
getProperties
Retrieve the property map of signed values.- Returns:
- Property map.
-
withName
Construct a new game profile with the same ID, but different name.- Parameters:
name- - the new name of the profile to create.- Returns:
- The new game profile.
-
withId
Construct a new game profile with the same name, but different id.- Parameters:
id- - the new id of the profile to create.- Returns:
- The new game profile.
-
isComplete
public boolean isComplete()Determine if the game profile contains both an UUID and a name.- Returns:
- TRUE if it does, FALSE otherwise.
-
toString
- Overrides:
toStringin classAbstractWrapper
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractWrapper
-
equals
- Overrides:
equalsin classAbstractWrapper
-