Package net.skinsrestorer.api.property
Class SkinIdentifier
java.lang.Object
net.skinsrestorer.api.property.SkinIdentifier
A skin identifier represents a reference skin that can be applied to a player.
A skin identifier always identifies a *stored* skin inside the storage.
(eg. file or database)
-
Method Summary
Modifier and TypeMethodDescriptionprotected booleanboolean@NonNull String@NonNull SkinType@Nullable SkinVariantOnly used forSkinType.URL, otherwise null.inthashCode()static SkinIdentifierof(String skinIdentifier, @Nullable SkinVariant skinVariant, SkinType skinType) Not recommended to use, use the other methods instead.static SkinIdentifierCreate a new SkinIdentifier for a custom skin.static SkinIdentifierCreate a new SkinIdentifier for a player skin in the storage.static SkinIdentifierofURL(String url, @Nullable SkinVariant skinVariant) Create a new SkinIdentifier for a web URL.@NotNull StringtoString()
-
Method Details
-
ofPlayer
Create a new SkinIdentifier for a player skin in the storage. A player is identified by his UUID that was assigned to them by Mojang. This is for getting a public mojang skin, not the skin of a player that is on the server. For getting the skin identifier of a player on the server, seePlayerStorage.getSkinIdOfPlayer(UUID).- Parameters:
uuid- The UUID of the premium player.- Returns:
- A new SkinIdentifier.
-
ofURL
Create a new SkinIdentifier for a web URL. The url must resolve to a valid skin png file. The variant identifies a specific skin variant of the skin file. If null, the plugin will use what MineSkin determines as the default variant.- Parameters:
url- The URL of the skin.skinVariant- The variant of the skin.- Returns:
- A new SkinIdentifier.
-
ofCustom
Create a new SkinIdentifier for a custom skin. A custom skin can either be hardcoded into the plugin or be created by an admin. In a command, it's checked first if the skin is a custom skin, then if it's a player skin.- Parameters:
skinName- The name of the custom skin.- Returns:
- A new SkinIdentifier.
-
of
@Internal public static SkinIdentifier of(String skinIdentifier, @Nullable @Nullable SkinVariant skinVariant, SkinType skinType) Not recommended to use, use the other methods instead. Only use is for storage.- Parameters:
skinIdentifier- The identifier can be a UUID, a URL or a custom name.skinVariant- Only used forSkinType.URL, otherwise null.skinType- The type of the skin.- Returns:
- A new SkinIdentifier.
-
getPlayerUniqueId
Converts theStringidentifier to aUUID. This is only possible if the skin type isSkinType.PLAYER.- Returns:
- The UUID of the player.
- Throws:
IllegalStateException- If the skin type is notSkinType.PLAYER.
-
getIdentifier
-
getSkinVariant
Only used forSkinType.URL, otherwise null. -
getSkinType
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-