Class ItemsAdder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAdvanced stuff, better not touch it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyResourcepack(org.bukkit.entity.Player player) Applies the Resource pack set for ItemsAdder to the provided player.static booleanDeprecated.static List<CustomStack>Returns all the registered items.static List<CustomStack>getAllItems(String namespace) Returns all the registered items by a specific namespace.static List<CustomStack>getAllItems(org.bukkit.Material material) Returns all the registered items which use a specific Bukkit Material.static org.bukkit.inventory.ItemStackgetCustomBlock(org.bukkit.block.Block block) Deprecated.static org.bukkit.block.data.BlockDatagetCustomBlockBlockData(org.bukkit.inventory.ItemStack customBlock, boolean lightweight) Deprecated.static org.bukkit.inventory.ItemStackgetCustomBlockByFaces(org.bukkit.Material material, HashMap<org.bukkit.block.BlockFace, Boolean> blockFaces) Deprecated.static List<org.bukkit.inventory.ItemStack>getCustomBlockLoot(org.bukkit.block.Block block) Deprecated.static List<org.bukkit.inventory.ItemStack>getCustomBlockLoot(org.bukkit.block.Block block, boolean includeSelfBlock) Deprecated.static List<org.bukkit.inventory.ItemStack>getCustomBlockLoot(org.bukkit.block.Block block, org.bukkit.inventory.ItemStack tool, boolean includeSelfBlock) Deprecated.static org.bukkit.inventory.ItemStackgetCustomItem(String namespacedId) Deprecated.static intgetCustomItemDurability(org.bukkit.inventory.ItemStack itemStack) Deprecated.static intgetCustomItemMaxDurability(org.bukkit.inventory.ItemStack itemStack) Deprecated.static StringgetCustomItemName(org.bukkit.inventory.ItemStack itemStack) Deprecated.static intgetCustomItemUsages(org.bukkit.inventory.ItemStack itemStack) Deprecated.static StringgetCustomSeedNameFromCrop(org.bukkit.block.Block block) Deprecated.static @Nullable StringgetLiquidName(org.bukkit.Location location) Deprecated.Deprecated.getNamespacedBlocksNamesInConfig(String searchStr) Deprecated.static @Nullable StringgetPackUrl(boolean appendHash) Retrieve the resourcepack direct download URL.static booleanhasKeepOnDeath(String namespacedId) Check if a custom item has keep_on_death behaviour enabled.static booleanhasKeepOnDeath(org.bukkit.inventory.ItemStack itemStack) Check if a custom item has keep_on_death behaviour enabled.static booleanisCustomBlock(org.bukkit.block.Block block) Deprecated.static booleanisCustomCrop(org.bukkit.block.Block block) Deprecated.static booleanisCustomItem(String customItemName) Deprecated.static booleanisCustomItem(org.bukkit.inventory.ItemStack itemStack) Deprecated.static booleanisCustomRecipe(String namespacedKey) Check if a custom recipe is registered by ItemsAdder.static booleanisCustomRecipe(org.bukkit.NamespacedKey namespacedKey) Check if a custom recipe is registered by ItemsAdder.static booleanisFurniture(org.bukkit.entity.Entity entity) Deprecated.static booleanmatchCustomItemName(org.bukkit.inventory.ItemStack itemStack, String customItemName) Deprecated.static voidplaceCustomBlock(org.bukkit.Location location, org.bukkit.inventory.ItemStack itemStack) Deprecated.static voidplaceCustomCrop(org.bukkit.Location location, org.bukkit.inventory.ItemStack seed) Deprecated.static booleanplayTotemAnimation(org.bukkit.entity.Player player, String namespacedId) Play totem animation.static voidremoveCustomBlock(org.bukkit.Location location) Deprecated.static org.bukkit.inventory.ItemStacksetCustomItemDurability(org.bukkit.inventory.ItemStack item, int durability) Deprecated.static org.bukkit.inventory.ItemStacksetCustomItemMaxDurability(org.bukkit.inventory.ItemStack item, int maxDurability) Deprecated.static voidDeprecated.
-
Constructor Details
-
ItemsAdder
public ItemsAdder()
-
-
Method Details
-
areItemsLoaded
Deprecated.Please listen toItemsAdderLoadDataEventevent instead. -
isCustomItem
Deprecated.Please useCustomStack.byItemStack(ItemStack)!= nullinstead. -
isCustomItem
Deprecated.Please useCustomStack.getInstance(String)!= nullinstead. -
getCustomItem
Deprecated.Please useCustomStack.getInstance(String)instead. -
placeCustomBlock
@Deprecated public static void placeCustomBlock(org.bukkit.Location location, org.bukkit.inventory.ItemStack itemStack) Deprecated.Please useCustomBlock.place(Location)instead. -
removeCustomBlock
Deprecated.Please useCustomBlockinstead. -
getCustomBlockByFaces
@Deprecated public static org.bukkit.inventory.ItemStack getCustomBlockByFaces(org.bukkit.Material material, HashMap<org.bukkit.block.BlockFace, Boolean> blockFaces) Deprecated.Please don't use this method anymore, it's not reliable as blocks are not only mushrooms.Get a custom block based on the
BlockFacevalues.- Parameters:
material-blockFaces-- Returns:
-
isCustomBlock
Deprecated.Please useCustomBlockinstead. -
getCustomBlockLoot
@Deprecated public static List<org.bukkit.inventory.ItemStack> getCustomBlockLoot(org.bukkit.block.Block block, boolean includeSelfBlock) Deprecated.Please useCustomBlockinstead. -
getCustomBlockLoot
@Deprecated public static List<org.bukkit.inventory.ItemStack> getCustomBlockLoot(org.bukkit.block.Block block) Deprecated.Please useCustomBlockinstead. -
getCustomBlockLoot
@Deprecated public static List<org.bukkit.inventory.ItemStack> getCustomBlockLoot(org.bukkit.block.Block block, org.bukkit.inventory.ItemStack tool, boolean includeSelfBlock) Deprecated.Please useCustomBlockinstead. -
placeCustomCrop
@Deprecated public static void placeCustomCrop(org.bukkit.Location location, org.bukkit.inventory.ItemStack seed) Deprecated.Please useCustomCropinstead. -
isCustomCrop
Deprecated.Please useCustomCropinstead. -
getCustomSeedNameFromCrop
Deprecated.Please useCustomCropinstead. -
getCustomBlock
@Deprecated public static org.bukkit.inventory.ItemStack getCustomBlock(org.bukkit.block.Block block) Deprecated.Please useCustomBlockinstead.Gets a CustomBlock instance through the provided Bukkit Block.
This may return null if the provided Block is not associated with a CustomBlock.- Parameters:
block- The Bukkit Block to get the CustomBlock from.- Returns:
- Possibly-null CustomBlock instance.
-
matchCustomItemName
@Deprecated public static boolean matchCustomItemName(org.bukkit.inventory.ItemStack itemStack, String customItemName) Deprecated.Please useCustomStackinstead.Returns whether the namespace and id of the provided CustomStack match the one of this CustomStack.
- Parameters:
itemStack- The CustomStack to check the namespace and id against.customItemName- The CustomStack ID in the formatnamespace:idto check the item namespaced ID against.- Returns:
- true if namespace and id match, otherwise false.
-
isFurniture
Deprecated.Please useCustomFurnitureinstead.Check if a Bukkit
Entityis a custom furniture.- Parameters:
entity- TheBukkitentity.- Returns:
- true if it's a custom entity, false if not.
-
getCustomItemName
Deprecated.Please useCustomStackinstead.Gets the namespace and id of this CustomStack instance in the format
namespace:id- Parameters:
itemStack- Custom item.- Returns:
- String representing namespace and id of the custom item.
-
getCustomItemUsages
Deprecated.Please useCustomStackinstead.Get custom usages of a custom item. (Usages is a special property of this plugin. It's not a Vanilla attribute)
- Parameters:
itemStack- Custom item.- Returns:
- Custom durability of a custom item.
-
setCustomItemDurability
@Deprecated public static org.bukkit.inventory.ItemStack setCustomItemDurability(org.bukkit.inventory.ItemStack item, int durability) Deprecated.Please useCustomStackinstead.Set the custom durability of a custom item.
- Parameters:
item- Custom item.durability- Durability to set.- Returns:
- The modified ItemStack.
-
setCustomItemMaxDurability
@Deprecated public static org.bukkit.inventory.ItemStack setCustomItemMaxDurability(org.bukkit.inventory.ItemStack item, int maxDurability) Deprecated.Please useCustomStackinstead.Set the custom durability of a custom item.
- Parameters:
item- Custom item.maxDurability- Max durability to set.- Returns:
- The modified ItemStack.
-
getCustomItemDurability
Deprecated.Please useCustomStackinstead.Get the custom durability of a custom item.
- Parameters:
itemStack- Custom item.- Returns:
- Custom durability of a custom item.
-
getCustomItemMaxDurability
Deprecated.Please useCustomStackinstead.Get the custom max durability of a custom item.
- Parameters:
itemStack- Custom item.- Returns:
- Custom max durability of a custom item.
-
getNamespacedBlocksNamesInConfig
Deprecated.Get list of custom blocks IDs in the formatnamespace:idwhich contains thesearchStrkeyword.- Parameters:
searchStr- Keyword to search for.- Returns:
- Complete list of custom blocks IDs in the format
namespace:id.
-
getNamespacedBlocksNamesInConfig
Deprecated.Get complete list of custom blocks IDs in the formatnamespace:id.- Returns:
- Complete list of custom blocks IDs in the format
namespace:id.
-
getCustomBlockBlockData
@Deprecated public static org.bukkit.block.data.BlockData getCustomBlockBlockData(org.bukkit.inventory.ItemStack customBlock, boolean lightweight) Deprecated.Please useCustomStackinstead.Get the Bukkit
BlockData- Parameters:
customBlock- The ItemStack of the custom block you want to get BukkitBlockDataof.lightweight- Unused property.- Returns:
- Bukkit
BlockData
-
playTotemAnimation
Play totem animation.
Warning: Make sure to delay it using a bukkit runnable (1 tick should be ok) if you call this after you close an inventory or sometimes animation won't show.- Parameters:
player- The player to play the anomation towards.namespacedId- The ID in the formatnamespace:idto get the totem animation from.- Returns:
- true if successful, false when provided ID was invalid.
-
setLiquid
Deprecated.Place a custom liquid in the specified location.- Parameters:
namespacedID- The ID in the formatnamespace:idof the liquid you want to place.location- Location of where you want to place the liquid
-
getLiquidName
Deprecated.Get the name of the liquid in this location.- Parameters:
location- Location you want to check.- Returns:
- null if no custom liquid is available in the location.
-
hasKeepOnDeath
public static boolean hasKeepOnDeath(org.bukkit.inventory.ItemStack itemStack) Check if a custom item has keep_on_death behaviour enabled.- Parameters:
itemStack- the custom item- Returns:
- true if it has 'keep_on_death: true', false if not or if it's not a custom item
-
hasKeepOnDeath
Check if a custom item has keep_on_death behaviour enabled.- Parameters:
namespacedId- Namespace and ID in the formatnamespace:idof the custom item- Returns:
- true if it has 'keep_on_death: true', false if not or if it's not a custom item
-
applyResourcepack
public static void applyResourcepack(org.bukkit.entity.Player player) Applies the Resource pack set for ItemsAdder to the provided player.- Parameters:
player- The player to apply the resource pack to.
-
getAllItems
Returns all the registered items.- Returns:
- null if ItemsAdder is not loaded completely, be sure to listen to ItemsAdderLoadDataEvent
-
getAllItems
Returns all the registered items by a specific namespace.- Returns:
- null if ItemsAdder is not loaded completely, be sure to listen to ItemsAdderLoadDataEvent
-
getAllItems
Returns all the registered items which use a specific Bukkit Material.- Returns:
- null if ItemsAdder is not loaded completely, be sure to listen to ItemsAdderLoadDataEvent
-
isCustomRecipe
public static boolean isCustomRecipe(org.bukkit.NamespacedKey namespacedKey) Check if a custom recipe is registered by ItemsAdder.- Parameters:
namespacedKey- the recipe namespaced key.- Returns:
- true if it's an ItemsAdder recipe, false if not.
-
isCustomRecipe
Check if a custom recipe is registered by ItemsAdder.- Parameters:
namespacedKey- the recipe Namespace and ID in the formatnamespace:id.- Returns:
- true if it's an ItemsAdder recipe, false if not.
-
getPackUrl
Retrieve the resourcepack direct download URL.- Parameters:
appendHash- append the hash to the URL or not.- Returns:
- returns the URL if is available, null if the resourcepack is still generating or the plugin still loading.
-