Interface PlayerTextures


public interface PlayerTextures
Provides access to the textures stored inside a PlayerProfile.

Modifying the textures immediately invalidates and clears any previously present attributes that are specific to official player profiles, such as the timestamp and signature.

  • Method Details

    • isEmpty

      boolean isEmpty()
      Checks if the profile stores no textures.
      Returns:
      true if the profile stores no textures
    • clear

      void clear()
      Clears the textures.
    • getSkin

      Gets the URL that points to the player's skin.
      Returns:
      the URL of the player's skin, or null if not set
    • setSkin

      void setSkin(@Nullable @Nullable URL skinUrl)
      Sets the player's skin to the specified URL, and the skin model to PlayerTextures.SkinModel.CLASSIC.

      The URL must point to the Minecraft texture server. Example URL:

       http://textures.minecraft.net/texture/b3fbd454b599df593f57101bfca34e67d292a8861213d2202bb575da7fd091ac
       
      Parameters:
      skinUrl - the URL of the player's skin, or null to unset it
    • setSkin

      Sets the player's skin and PlayerTextures.SkinModel.

      The URL must point to the Minecraft texture server. Example URL:

       http://textures.minecraft.net/texture/b3fbd454b599df593f57101bfca34e67d292a8861213d2202bb575da7fd091ac
       

      A skin model of null results in PlayerTextures.SkinModel.CLASSIC to be used.

      Parameters:
      skinUrl - the URL of the player's skin, or null to unset it
      skinModel - the skin model, ignored if the skin URL is null
    • getSkinModel

      Gets the model of the player's skin.

      This returns PlayerTextures.SkinModel.CLASSIC if no skin is set.

      Returns:
      the model of the player's skin
    • getCape

      Gets the URL that points to the player's cape.
      Returns:
      the URL of the player's cape, or null if not set
    • setCape

      void setCape(@Nullable @Nullable URL capeUrl)
      Sets the URL that points to the player's cape.

      The URL must point to the Minecraft texture server. Example URL:

       http://textures.minecraft.net/texture/2340c0e03dd24a11b15a8b33c2a7e9e32abb2051b2481d0ba7defd635ca7a933
       
      Parameters:
      capeUrl - the URL of the player's cape, or null to unset it
    • getTimestamp

      long getTimestamp()
      Gets the timestamp at which the profile was last updated.
      Returns:
      the timestamp, or 0 if unknown
    • isSigned

      boolean isSigned()
      Checks if the textures are signed and the signature is valid.
      Returns:
      true if the textures are signed and the signature is valid