Class SkinAPI

java.lang.Object
dev.cwhead.GravesX.api.skin.SkinAPI

public final class SkinAPI extends Object
Skin/texture/profile helper API.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Utility class; prevent instantiation.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable com.mojang.authlib.GameProfile
    getPlayerGameProfile(@NotNull org.bukkit.entity.Player player)
    Retrieves the GameProfile of the specified player.
    static @Nullable org.bukkit.profile.PlayerProfile
    getPlayerProfile(@NotNull org.bukkit.entity.Player player)
    Retrieves the PlauerProfile of the specified player.
    static String
    getSkinSignature(@NotNull org.bukkit.entity.Entity entity)
    Gets the skin signature of the specified entity if it is a player.
    static @Nullable String
    getTexture(@NotNull org.bukkit.entity.Entity entity)
    Retrieves the texture of the specified entity.
    static void
    setSkullTexture(@NotNull org.bukkit.block.Skull skull, @NotNull String name, @NotNull String base64)
    Sets the texture of a Skull block.
    static void
    setSkullTexture(@NotNull org.bukkit.inventory.meta.SkullMeta skullMeta, @NotNull String name, @NotNull String base64)
    Sets the texture of a Skull item stack.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SkinAPI

      public SkinAPI()
      Utility class; prevent instantiation.
  • Method Details

    • getSkinSignature

      public static String getSkinSignature(@NotNull @NotNull org.bukkit.entity.Entity entity)
      Gets the skin signature of the specified entity if it is a player.
      Parameters:
      entity - The entity whose skin signature is to be retrieved.
      Returns:
      The skin signature of the player, or null if the entity is not a player or the signature could not be retrieved.
    • setSkullTexture

      public static void setSkullTexture(@NotNull @NotNull org.bukkit.block.Skull skull, @NotNull @NotNull String name, @NotNull @NotNull String base64)
      Sets the texture of a Skull block.
      Parameters:
      skull - The Skull block.
      name - The name associated with the texture.
      base64 - The Base64 encoded texture.
    • setSkullTexture

      public static void setSkullTexture(@NotNull @NotNull org.bukkit.inventory.meta.SkullMeta skullMeta, @NotNull @NotNull String name, @NotNull @NotNull String base64)
      Sets the texture of a Skull item stack.
      Parameters:
      skullMeta - The SkullMeta item meta.
      name - The name associated with the texture.
      base64 - The Base64 encoded texture.
    • getTexture

      @Nullable public static @Nullable String getTexture(@NotNull @NotNull org.bukkit.entity.Entity entity)
      Retrieves the texture of the specified entity.
      Parameters:
      entity - The entity from which to get the texture.
      Returns:
      The Base64 encoded texture string, or null if not found.
    • getPlayerGameProfile

      @Nullable public static @Nullable com.mojang.authlib.GameProfile getPlayerGameProfile(@NotNull @NotNull org.bukkit.entity.Player player)
      Retrieves the GameProfile of the specified player.
      Parameters:
      player - The player from which to get the GameProfile.
      Returns:
      The GameProfile of the player, or null if not found.
    • getPlayerProfile

      @Nullable public static @Nullable org.bukkit.profile.PlayerProfile getPlayerProfile(@NotNull @NotNull org.bukkit.entity.Player player)
      Retrieves the PlauerProfile of the specified player.
      Parameters:
      player - The player from which to get the GameProfile.
      Returns:
      The PlayerProfile of the player, or null if not found.