Class HeadUtils

java.lang.Object
org.leralix.lib.utils.HeadUtils

public class HeadUtils extends Object
The class used to manage every head related commands
  • Constructor Details

    • HeadUtils

      public HeadUtils()
  • Method Details

    • getPlayerHead

      public static org.bukkit.inventory.ItemStack getPlayerHead(String headName, org.bukkit.OfflinePlayer offlinePlayer, List<String> lore)
      Create a player head ItemStack.
      Parameters:
      headName - The name of the new created ItemStack.
      offlinePlayer - The player to extract the head from.
      lore - The lore of the new created ItemStack.
      Returns:
      The head of the player as an ItemStack.
    • getPlayerHead

      public static org.bukkit.inventory.ItemStack getPlayerHead(String headName, org.bukkit.OfflinePlayer offlinePlayer, String... loreLines)
      Create a player head ItemStack.
      Parameters:
      headName - The name of the new created ItemStack.
      offlinePlayer - The player to extract the head from.
      loreLines - The lore of the new created ItemStack.
      Returns:
      The head of the player as an ItemStack.
    • getPlayerHead

      public static org.bukkit.inventory.ItemStack getPlayerHead(org.bukkit.OfflinePlayer offlinePlayer, String... loreLines)
      Create a player head ItemStack.
      Parameters:
      offlinePlayer - The player to extract the head from.
      loreLines - The lore of the new created ItemStack.
      Returns:
      The head of the player as an ItemStack.
    • getPlayerHead

      public static org.bukkit.inventory.ItemStack getPlayerHead(String headName, org.bukkit.OfflinePlayer offlinePlayer)
      Create a player head ItemStack.
      Parameters:
      headName - The name of the new created ItemStack.
      offlinePlayer - The player to extract the head from.
      Returns:
      The head of the player as an ItemStack.
    • getPlayerHead

      public static org.bukkit.inventory.ItemStack getPlayerHead(org.bukkit.OfflinePlayer offlinePlayer)
      Create a player head with the player name as name of the ItemStack
      Parameters:
      offlinePlayer - The name of the new created ItemStack.
      Returns:
      The head of the player as an ItemStack.
    • makeSkullB64

      public static org.bukkit.inventory.ItemStack makeSkullB64(String name, String base64EncodedString, List<String> lore)
      Create a head from base64 encoded string This method is called when loading custom heads from the internet Check minecraft-heads.com for more heads. This method calls an unsafe bukkit methods but no other methods have been found
      Parameters:
      name - The name of the new created head.
      base64EncodedString - The base64 encoded String of the new head.
      lore - The lore of the new created head.
      Returns:
      The ItemStack with custom texture.
    • makeSkullURL

      public static org.bukkit.inventory.ItemStack makeSkullURL(String name, String url, String... lore)
    • makeSkullURL

      public static org.bukkit.inventory.ItemStack makeSkullURL(String name, String url, List<String> lore)
    • makeSkullURL

      public static org.bukkit.inventory.ItemStack makeSkullURL(String name, URL url, String... lore)
    • makeSkullURL

      public static org.bukkit.inventory.ItemStack makeSkullURL(String name, URL url, List<String> lore)
    • makeSkull

      public static org.bukkit.inventory.ItemStack makeSkull(String name, org.bukkit.profile.PlayerProfile profile, List<String> lore)
    • getUrlFromBase64_2

      public static URL getUrlFromBase64_2(String base64)
    • makeSkullB64

      public static org.bukkit.inventory.ItemStack makeSkullB64(String name, String base64EncodedString)
      Create a head from base64 encoded string This method is called when loading custom heads from the internet Check minecraft-heads.com for more heads. This method calls an unsafe bukkit methods but no other methods have been found
      Parameters:
      name - The name of the new created head.
      base64EncodedString - The base64 encoded String of the new head.
      Returns:
      The ItemStack with custom texture.
    • makeSkullB64

      public static org.bukkit.inventory.ItemStack makeSkullB64(String name, String base64EncodedString, String... loreLines)
      Create a head from base64 encoded string This method is called when loading custom heads from the internet Check minecraft-heads.com for more heads. This method calls an unsafe bukkit methods but no other methods have been found
      Parameters:
      name - The name of the new created head.
      base64EncodedString - The base64 encoded String of the new head.
      loreLines - The lore of the new created head.
      Returns:
      The ItemStack with custom texture.
    • makeSkullB64

      public static org.bukkit.inventory.ItemStack makeSkullB64(String name, String base64EncodedString, List<String> lore, String... loreLines)
      Create a head from base64 encoded string This method is called when loading custom heads from the internet Check minecraft-heads.com for more heads. This method calls an unsafe bukkit methods but no other methods have been found
      Parameters:
      name - The name of the new created head.
      base64EncodedString - The base64 encoded String of the new head.
      lore - The lore of the new created head.
      loreLines - Additional lore.
      Returns:
      The ItemStack with custom texture.
    • createCustomItemStack

      public static org.bukkit.inventory.ItemStack createCustomItemStack(org.bukkit.Material itemMaterial, String itemName)
      Create an ItemStack with custom Lore
      Parameters:
      itemMaterial - The data of the region to display
      itemName - The display name of the item
      Returns:
      The ItemStack displaying the town
    • createCustomItemStack

      public static org.bukkit.inventory.ItemStack createCustomItemStack(org.bukkit.Material itemMaterial, String itemName, String... loreLines)
      Create an ItemStack with custom Lore
      Parameters:
      itemMaterial - The data of the region to display
      itemName - The display name of the item
      loreLines - The lore of the item
      Returns:
      The ItemStack displaying the town
    • createCustomItemStack

      public static org.bukkit.inventory.ItemStack createCustomItemStack(org.bukkit.Material itemMaterial, String itemName, List<String> lore, String... loreLines)
      Create an ItemStack with custom Lore.
      Parameters:
      itemMaterial - The data of the region to display.
      itemName - The display name of the item.
      lore - The lore of the item.
      loreLines - Additional lore.
      Returns:
      The ItemStack displaying the town.
    • createCustomItemStack

      public static org.bukkit.inventory.ItemStack createCustomItemStack(org.bukkit.Material itemMaterial, String itemName, List<String> lore)
      Create an ItemStack with custom Lore.
      Parameters:
      itemMaterial - The data of the region to display.
      itemName - The display name of the item.
      lore - The lore of the item.
      Returns:
      The ItemStack displaying the town.
    • createCustomItemStack

      public static org.bukkit.inventory.ItemStack createCustomItemStack(org.bukkit.inventory.ItemStack item, String itemName, List<String> lore)
    • createCustomItemStack

      public static org.bukkit.inventory.ItemStack createCustomItemStack(org.bukkit.inventory.ItemStack item, String itemName, String... lore)
      Create an ItemStack with custom Lore.
      Parameters:
      item - The Itemstack to use.
      itemName - The display name of the item.
      lore - The lore of the item.
      Returns:
      The ItemStack displaying the town.
    • setLore

      public static void setLore(org.bukkit.inventory.ItemStack itemStack, List<String> lore)
      Set the lore of an ItemStack
      Parameters:
      itemStack - The item stack to set the lore
      lore - The lore to set
    • setLore

      public static void setLore(org.bukkit.inventory.ItemStack itemStack, String... loreLines)
      Set the lore of an ItemStack
      Parameters:
      itemStack - The item stack to set the lore
      loreLines - The lore to set
    • setLore

      public static void setLore(org.bukkit.inventory.ItemStack itemStack, List<String> lore, String... loreLines)
      Set the lore of an ItemStack
      Parameters:
      itemStack - The item stack to set the lore
      lore - The lore to set
      loreLines - Additional lore
    • addLore

      public static void addLore(org.bukkit.inventory.ItemStack itemStack, String... loreLines)
      Add lore to an ItemStack
      Parameters:
      itemStack - The item stack to add the lore
      loreLines - The lore to add