Class Skin

java.lang.Object
de.marcely.bedwars.tools.Skin

public class Skin extends Object
Contains the data of a player skin.
See Also:
  • Field Details

    • STEVE

      public static final Skin STEVE
      The default skin (Steve).

      Has no texture or signature, resulting in the default skin.

  • Method Details

    • getTexture

      public String getTexture()
      Returns the skin texture JSON-URL in base64.
      Returns:
      The skin texture JSON-URL in base64
    • getTextureURL

      @Nullable public @Nullable URL getTextureURL()
      Tries to decode the texture and returns its included URL.

      Attempts to cache the result after the first call.

      Returns:
      The skin texture URL, or null if the texture is invalid
      See Also:
    • isTextureValid

      public boolean isTextureValid()
      Returns whether the texture is a valid URL.

      Attempts to cache the result after the first call.

      Returns:
      true if the texture is a valid URL
    • getSignature

      public String getSignature()
      Returns the skin signature.
      Returns:
      The skin signaturese64
    • of

      public static Skin of(String texture, String signature)
      Creates a new skin instance.

      The values don't have to be valid here, any input is accepted.

      Parameters:
      texture - The texture, preferably a JSON-URL in base64
      signature - The signature in base64
      Returns:
      The skin instance
    • of

      public static Skin of(URL url, String signature)
      Creates a new skin instance.
      Parameters:
      url - The skin texture URL
      signature - The signature in base64
      Returns:
      The skin instance