Class SkinIdentifier

java.lang.Object
net.skinsrestorer.api.property.SkinIdentifier

public class SkinIdentifier extends Object
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 Details

    • ofPlayer

      public static SkinIdentifier ofPlayer(UUID uuid)
      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, see PlayerStorage.getSkinIdOfPlayer(UUID).
      Parameters:
      uuid - The UUID of the premium player.
      Returns:
      A new SkinIdentifier.
    • ofURL

      public static SkinIdentifier ofURL(String url, @Nullable @Nullable SkinVariant skinVariant)
      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

      public static SkinIdentifier ofCustom(String skinName)
      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, 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 for SkinType.URL, otherwise null.
      skinType - The type of the skin.
      Returns:
      A new SkinIdentifier.
    • getIdentifier

      @NonNull public @NonNull String getIdentifier()
    • getSkinVariant

      public SkinVariant getSkinVariant()
      Only used for SkinType.URL, otherwise null.
    • getSkinType

      @NonNull public @NonNull SkinType getSkinType()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object