Package org.leralix.lib.utils
Class HeadUtils
java.lang.Object
org.leralix.lib.utils.HeadUtils
The class used to manage every head related commands
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Add lore to anItemStack
static org.bukkit.inventory.ItemStack
createCustomItemStack
(org.bukkit.inventory.ItemStack item, String itemName, String... lore) Create anItemStack
with custom Lore.static org.bukkit.inventory.ItemStack
createCustomItemStack
(org.bukkit.inventory.ItemStack item, String itemName, List<String> lore) static org.bukkit.inventory.ItemStack
createCustomItemStack
(org.bukkit.Material itemMaterial, String itemName) Create anItemStack
with custom Lorestatic org.bukkit.inventory.ItemStack
createCustomItemStack
(org.bukkit.Material itemMaterial, String itemName, String... loreLines) Create anItemStack
with custom Lorestatic org.bukkit.inventory.ItemStack
createCustomItemStack
(org.bukkit.Material itemMaterial, String itemName, List<String> lore) Create anItemStack
with custom Lore.static org.bukkit.inventory.ItemStack
createCustomItemStack
(org.bukkit.Material itemMaterial, String itemName, List<String> lore, String... loreLines) Create anItemStack
with custom Lore.static org.bukkit.inventory.ItemStack
getPlayerHead
(String headName, org.bukkit.OfflinePlayer offlinePlayer) Create a player headItemStack
.static org.bukkit.inventory.ItemStack
getPlayerHead
(String headName, org.bukkit.OfflinePlayer offlinePlayer, String... loreLines) Create a player headItemStack
.static org.bukkit.inventory.ItemStack
getPlayerHead
(String headName, org.bukkit.OfflinePlayer offlinePlayer, List<String> lore) Create a player headItemStack
.static org.bukkit.inventory.ItemStack
getPlayerHead
(org.bukkit.OfflinePlayer offlinePlayer) Create a player head with the player name as name of theItemStack
static org.bukkit.inventory.ItemStack
getPlayerHead
(org.bukkit.OfflinePlayer offlinePlayer, String... loreLines) Create a player headItemStack
.static URL
getUrlFromBase64_2
(String base64) static org.bukkit.inventory.ItemStack
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.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.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.static org.bukkit.inventory.ItemStack
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.static org.bukkit.inventory.ItemStack
makeSkullURL
(String name, String url, String... lore) static org.bukkit.inventory.ItemStack
makeSkullURL
(String name, String url, List<String> lore) static org.bukkit.inventory.ItemStack
makeSkullURL
(String name, URL url, String... lore) static org.bukkit.inventory.ItemStack
makeSkullURL
(String name, URL url, List<String> lore) static void
Set the lore of anItemStack
static void
Set the lore of anItemStack
static void
Set the lore of anItemStack
-
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 headItemStack
.- Parameters:
headName
- The name of the new createdItemStack
.offlinePlayer
- The player to extract the head from.lore
- The lore of the new createdItemStack
.- 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 headItemStack
.- Parameters:
headName
- The name of the new createdItemStack
.offlinePlayer
- The player to extract the head from.loreLines
- The lore of the new createdItemStack
.- 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 headItemStack
.- Parameters:
offlinePlayer
- The player to extract the head from.loreLines
- The lore of the new createdItemStack
.- 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 headItemStack
.- Parameters:
headName
- The name of the new createdItemStack
.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 theItemStack
- Parameters:
offlinePlayer
- The name of the new createdItemStack
.- 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
-
makeSkullURL
-
makeSkullURL
-
makeSkullURL
-
makeSkull
-
getUrlFromBase64_2
-
makeSkullB64
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 anItemStack
with custom Lore- Parameters:
itemMaterial
- The data of the region to displayitemName
- 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 anItemStack
with custom Lore- Parameters:
itemMaterial
- The data of the region to displayitemName
- The display name of the itemloreLines
- 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 anItemStack
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 anItemStack
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
-
createCustomItemStack
public static org.bukkit.inventory.ItemStack createCustomItemStack(org.bukkit.inventory.ItemStack item, String itemName, String... lore) Create anItemStack
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
Set the lore of anItemStack
- Parameters:
itemStack
- The item stack to set the lorelore
- The lore to set
-
setLore
Set the lore of anItemStack
- Parameters:
itemStack
- The item stack to set the loreloreLines
- The lore to set
-
setLore
public static void setLore(org.bukkit.inventory.ItemStack itemStack, List<String> lore, String... loreLines) Set the lore of anItemStack
- Parameters:
itemStack
- The item stack to set the lorelore
- The lore to setloreLines
- Additional lore
-
addLore
Add lore to anItemStack
- Parameters:
itemStack
- The item stack to add the loreloreLines
- The lore to add
-