Package me.arcaniax.hdb.api
Class HeadDatabaseAPI
java.lang.Object
me.arcaniax.hdb.api.HeadDatabaseAPI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddHead(CategoryEnum category, String name, String base64)Adds a head to the databaseaddHead(CategoryEnum category, String name, UUID uuid)Adds a head to the databasebooleanaddHead(CategoryEnum category, Head head)Adds a new Head to the databaseGets the base64 string from a head IDGets the base64 String from a BlockGets the base64 String from an ItemStackgetBlockID(Block block)Gets the head ID of a BlockgetCategory(String id)Gets the Category that a head ID is part ofgetHeads(CategoryEnum category)Gets a List of all Heads in a given category in the databasegetItemHead(String id)Gets an ItemStack of a head with the given IDgetItemHead(Block block)Gets an ItemStack of a head from a player skull BlockGets the head ID of an ItemStackbooleanisDecorativeHead(Block block)Checks if a Block is a decorative (non-player) headbooleanisDecorativeHead(ItemStack itemStack)Checks if an ItemStack is a decorative (non-player) headbooleanChecks whether a head exists with the given IDbooleanremoveHead(String id)Removes a head from the databasebooleansetBlockSkin(Block block, String id)Sets the texture of a player head block to the given head IDvoidsetPrefixID(String prefix)Sets the prefix ID to be used by the API for added heads
-
Constructor Details
-
HeadDatabaseAPI
public HeadDatabaseAPI()
-
-
Method Details
-
setPrefixID
Sets the prefix ID to be used by the API for added heads- Parameters:
prefix- The prefix to use
-
isHead
Checks whether a head exists with the given ID- Parameters:
ID- The ID to check- Returns:
- true if a head exists with the given ID, otherwise false
-
isDecorativeHead
Checks if a Block is a decorative (non-player) head- Parameters:
block- The block to check- Returns:
- true if the block is a decorative head, otherwise false
-
isDecorativeHead
Checks if an ItemStack is a decorative (non-player) head- Parameters:
itemStack- The item to check- Returns:
- true if the item is a decorative head, otherwise false
-
getItemHead
Gets an ItemStack of a head with the given ID- Parameters:
id- The ID of the head to get- Returns:
- An ItemStack of a head with the given ID, or null if one does not exist
-
getItemHead
Gets an ItemStack of a head from a player skull Block- Parameters:
block- The ID of the head to get- Returns:
- An ItemStack of a head from the given block, or null if the block is not a head
-
getItemID
Gets the head ID of an ItemStack- Parameters:
itemStack- The item to get the ID from- Returns:
- The head ID of the item, or null if the item is not a head or is not in the database
-
getBlockID
Gets the head ID of a Block- Parameters:
block- The block to get the ID from- Returns:
- The head ID of the block, or null if the block is not a head or is not in the database
-
getBase64
Gets the base64 string from a head ID- Parameters:
id- The ID of the head- Returns:
- The base64 String from a head ID, or null if one does not exist
-
getBase64
Gets the base64 String from an ItemStack- Parameters:
itemStack- The ItemStack- Returns:
- The base64 String from an ItemStack, or null if one does not exist
-
getBase64
Gets the base64 String from a Block- Parameters:
block- The Block to get the base64 string from- Returns:
- The base64 String from the Block, or null if the block is not a head or does not have a base64 String
-
addHead
Adds a new Head to the database- Parameters:
category- The category to add the head tohead- The head to add- Returns:
- true if the head was successfully added, otherwise false
-
getHeads
Gets a List of all Heads in a given category in the database- Parameters:
category- The category to check- Returns:
- A list of heads in the given category, or an empty list if none
-
getRandomHead
- Returns:
- a random head from the database as an ItemStack
-
getCategory
Gets the Category that a head ID is part of- Parameters:
id- The ID of the head- Returns:
- The category that the head ID belongs to, or null if not found
-
setBlockSkin
Sets the texture of a player head block to the given head ID- Parameters:
block- The block to set the texture ofid- The ID of the head to set the texture to- Returns:
- true if the block texture was successfully applied, otherwise false
-
addHead
Adds a head to the database- Parameters:
category- The category to add toname- The name of the headuuid- The UUID owner of the head- Returns:
- The ID of the head that was added, or null if unable to add
-
addHead
Adds a head to the database- Parameters:
category- The category to add toname- The name of the headbase64- The base64 texture string of the head- Returns:
- The ID of the head that was added, or null if unable to add
-
removeHead
Removes a head from the database- Parameters:
id- The ID of the head to remove- Returns:
- true if the head was removed, or false if a head with the ID was not found
-