Class ItemsAdder

java.lang.Object
dev.lone.itemsadder.api.ItemsAdder

public class ItemsAdder extends Object
  • Constructor Details

    • ItemsAdder

      public ItemsAdder()
  • Method Details

    • areItemsLoaded

      @Deprecated public static boolean areItemsLoaded()
      Deprecated.
      Please listen to ItemsAdderLoadDataEvent event instead.
    • isCustomItem

      @Deprecated public static boolean isCustomItem(org.bukkit.inventory.ItemStack itemStack)
      Deprecated.
      Please use CustomStack.byItemStack(ItemStack) != null instead.
    • isCustomItem

      @Deprecated public static boolean isCustomItem(String customItemName)
      Deprecated.
      Please use CustomStack.getInstance(String) != null instead.
    • getCustomItem

      @Deprecated public static org.bukkit.inventory.ItemStack getCustomItem(String namespacedId)
      Deprecated.
    • placeCustomBlock

      @Deprecated public static void placeCustomBlock(org.bukkit.Location location, org.bukkit.inventory.ItemStack itemStack)
      Deprecated.
      Please use CustomBlock.place(Location) instead.
    • removeCustomBlock

      @Deprecated public static void removeCustomBlock(org.bukkit.Location location)
      Deprecated.
      Please use CustomBlock instead.
    • 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 BlockFace values.

      Parameters:
      material -
      blockFaces -
      Returns:
    • isCustomBlock

      @Deprecated public static boolean isCustomBlock(org.bukkit.block.Block block)
      Deprecated.
      Please use CustomBlock instead.
    • getCustomBlockLoot

      @Deprecated public static List<org.bukkit.inventory.ItemStack> getCustomBlockLoot(org.bukkit.block.Block block, boolean includeSelfBlock)
      Deprecated.
      Please use CustomBlock instead.
    • getCustomBlockLoot

      @Deprecated public static List<org.bukkit.inventory.ItemStack> getCustomBlockLoot(org.bukkit.block.Block block)
      Deprecated.
      Please use CustomBlock instead.
    • getCustomBlockLoot

      @Deprecated public static List<org.bukkit.inventory.ItemStack> getCustomBlockLoot(org.bukkit.block.Block block, org.bukkit.inventory.ItemStack tool, boolean includeSelfBlock)
      Deprecated.
      Please use CustomBlock instead.
    • placeCustomCrop

      @Deprecated public static void placeCustomCrop(org.bukkit.Location location, org.bukkit.inventory.ItemStack seed)
      Deprecated.
      Please use CustomCrop instead.
    • isCustomCrop

      @Deprecated public static boolean isCustomCrop(org.bukkit.block.Block block)
      Deprecated.
      Please use CustomCrop instead.
    • getCustomSeedNameFromCrop

      @Deprecated public static String getCustomSeedNameFromCrop(org.bukkit.block.Block block)
      Deprecated.
      Please use CustomCrop instead.
    • getCustomBlock

      @Deprecated public static org.bukkit.inventory.ItemStack getCustomBlock(org.bukkit.block.Block block)
      Deprecated.
      Please use CustomBlock instead.

      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 use CustomStack instead.

      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 format namespace:id to check the item namespaced ID against.
      Returns:
      true if namespace and id match, otherwise false.
    • isFurniture

      @Deprecated public static boolean isFurniture(org.bukkit.entity.Entity entity)
      Deprecated.
      Please use CustomFurniture instead.

      Check if a Bukkit Entity is a custom furniture.

      Parameters:
      entity - The Bukkit entity.
      Returns:
      true if it's a custom entity, false if not.
    • getCustomItemName

      @Deprecated public static String getCustomItemName(org.bukkit.inventory.ItemStack itemStack)
      Deprecated.
      Please use CustomStack instead.

      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 public static int getCustomItemUsages(org.bukkit.inventory.ItemStack itemStack)
      Deprecated.
      Please use CustomStack instead.

      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 use CustomStack instead.

      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 use CustomStack instead.

      Set the custom durability of a custom item.

      Parameters:
      item - Custom item.
      maxDurability - Max durability to set.
      Returns:
      The modified ItemStack.
    • getCustomItemDurability

      @Deprecated public static int getCustomItemDurability(org.bukkit.inventory.ItemStack itemStack)
      Deprecated.
      Please use CustomStack instead.

      Get the custom durability of a custom item.

      Parameters:
      itemStack - Custom item.
      Returns:
      Custom durability of a custom item.
    • getCustomItemMaxDurability

      @Deprecated public static int getCustomItemMaxDurability(org.bukkit.inventory.ItemStack itemStack)
      Deprecated.
      Please use CustomStack instead.

      Get the custom max durability of a custom item.

      Parameters:
      itemStack - Custom item.
      Returns:
      Custom max durability of a custom item.
    • getNamespacedBlocksNamesInConfig

      @Deprecated public static List<String> getNamespacedBlocksNamesInConfig(String searchStr)
      Deprecated.
      Get list of custom blocks IDs in the format namespace:id which contains the searchStr keyword.
      Parameters:
      searchStr - Keyword to search for.
      Returns:
      Complete list of custom blocks IDs in the format namespace:id.
    • getNamespacedBlocksNamesInConfig

      @Deprecated public static List<String> getNamespacedBlocksNamesInConfig()
      Deprecated.
      Get complete list of custom blocks IDs in the format namespace: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 use CustomStack instead.

      Get the Bukkit BlockData

      Parameters:
      customBlock - The ItemStack of the custom block you want to get Bukkit BlockData of.
      lightweight - Unused property.
      Returns:
      Bukkit BlockData
    • playTotemAnimation

      public static boolean playTotemAnimation(org.bukkit.entity.Player player, String namespacedId)
      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 format namespace:id to get the totem animation from.
      Returns:
      true if successful, false when provided ID was invalid.
    • setLiquid

      @Deprecated public static void setLiquid(String namespacedID, org.bukkit.Location location)
      Deprecated.
      Place a custom liquid in the specified location.
      Parameters:
      namespacedID - The ID in the format namespace:id of the liquid you want to place.
      location - Location of where you want to place the liquid
    • getLiquidName

      @Deprecated @Nullable public static @Nullable String getLiquidName(org.bukkit.Location location)
      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

      public static boolean hasKeepOnDeath(String namespacedId)
      Check if a custom item has keep_on_death behaviour enabled.
      Parameters:
      namespacedId - Namespace and ID in the format namespace:id of 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

      public static List<CustomStack> getAllItems()
      Returns all the registered items.
      Returns:
      null if ItemsAdder is not loaded completely, be sure to listen to ItemsAdderLoadDataEvent
    • getAllItems

      public static List<CustomStack> getAllItems(String namespace)
      Returns all the registered items by a specific namespace.
      Returns:
      null if ItemsAdder is not loaded completely, be sure to listen to ItemsAdderLoadDataEvent
    • getAllItems

      public static List<CustomStack> getAllItems(org.bukkit.Material material)
      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

      public static boolean isCustomRecipe(String namespacedKey)
      Check if a custom recipe is registered by ItemsAdder.
      Parameters:
      namespacedKey - the recipe Namespace and ID in the format namespace:id.
      Returns:
      true if it's an ItemsAdder recipe, false if not.
    • getPackUrl

      @Nullable public static @Nullable String getPackUrl(boolean appendHash)
      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.