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
ConstructorDescriptionPlayerSkin
(String textures, String signature) Creates an instance of aPlayerSkin
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static @Nullable PlayerSkin
fromUsername
(@NotNull String username) Gets a skin from a Minecraft username.static @Nullable PlayerSkin
Gets a skin from a Mojang UUID.final int
hashCode()
Returns a hash code value for this object.Returns the value of thesignature
record component.textures()
Returns the value of thetextures
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
PlayerSkin
Creates an instance of aPlayerSkin
record class.- Parameters:
textures
- the value for thetextures
record componentsignature
- the value for thesignature
record 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 thetextures
record component.- Returns:
- the value of the
textures
record component
-
signature
Returns the value of thesignature
record component.- Returns:
- the value of the
signature
record component
-