Package net.minestom.server.entity
Record Class PlayerSkin
java.lang.Object
java.lang.Record
net.minestom.server.entity.PlayerSkin
Contains all the data required to store a skin.
Can be applied to a player with Player.setSkin(PlayerSkin)
or in the linked event PlayerSkinInitEvent.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerSkin(String textures, String signature) Creates an instance of aPlayerSkinrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static @Nullable PlayerSkinfromUsername(@NotNull String username) Gets a skin from a Minecraft username.static @Nullable PlayerSkinGets a skin from a Mojang UUID.final inthashCode()Returns a hash code value for this object.Returns the value of thesignaturerecord component.textures()Returns the value of thetexturesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PlayerSkin
Creates an instance of aPlayerSkinrecord class.- Parameters:
textures- the value for thetexturesrecord componentsignature- the value for thesignaturerecord component
-
-
Method Details
-
fromUuid
Gets a skin from a Mojang UUID.- Parameters:
uuid- Mojang UUID- Returns:
- a player skin based on the UUID, null if not found
-
fromUsername
@Blocking @Nullable public static @Nullable PlayerSkin fromUsername(@NotNull @NotNull String username) Gets a skin from a Minecraft username.- Parameters:
username- the Minecraft username- Returns:
- a skin based on a Minecraft username, null if not found
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
textures
Returns the value of thetexturesrecord component.- Returns:
- the value of the
texturesrecord component
-
signature
Returns the value of thesignaturerecord component.- Returns:
- the value of the
signaturerecord component
-