java.lang.Object
io.rhythmknights.coreapi.component.utility.SkullUtil

public final class SkullUtil extends Object
  • Constructor Details

    • SkullUtil

      public SkullUtil()
  • Method Details

    • skull

      public static org.bukkit.inventory.ItemStack skull()
      Create a player skull
      Returns:
      player skull
    • isPlayerSkull

      public static boolean isPlayerSkull(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Checks if an ItemStack is a player skull
      Parameters:
      item - item to check
      Returns:
      whether the item is a player skull
    • getSkinUrl

      public static String getSkinUrl(String base64Texture)
      Decode a base64 string and extract the url of the skin. Example:
      - Base64: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGNlYjE3MDhkNTQwNGVmMzI2MTAzZTdiNjA1NTljOTE3OGYzZGNlNzI5MDA3YWM5YTBiNDk4YmRlYmU0NjEwNyJ9fX0=
      - JSON: {"textures":{"SKIN":{"url":"http://textures.minecraft.net/texture/dceb1708d5404ef326103e7b60559c9178f3dce729007ac9a0b498bdebe46107"}}}
      - Result: http://textures.minecraft.net/texture/dceb1708d5404ef326103e7b60559c9178f3dce729007ac9a0b498bdebe46107
      Parameters:
      base64Texture - the texture
      Returns:
      the url of the texture if found, otherwise null