Class CustomItemManager

java.lang.Object
org.strassburger.lifestealz.util.customitems.CustomItemManager

public final class CustomItemManager extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.bukkit.NamespacedKey
     
    static final org.bukkit.NamespacedKey
     
    static final org.bukkit.NamespacedKey
     
    static final org.bukkit.NamespacedKey
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.inventory.ItemStack
    createBackItem(int page)
    Creates a back item for paginated GUIs
    static org.bukkit.inventory.ItemStack
    Creates a close item for GUIs
    static org.bukkit.inventory.ItemStack
    Creates a custom item
    static org.bukkit.inventory.ItemStack
    createCustomItem(String itemId, int amount)
    Creates a custom item with a specific amount
    static org.bukkit.inventory.ItemStack
    Creates the default heart item
    static org.bukkit.inventory.ItemStack
    Creates the revive heart item
    static org.bukkit.inventory.ItemStack
    Creates the kill heart item
    static org.bukkit.inventory.ItemStack
    Creates the max hearts heart item
    static org.bukkit.inventory.ItemStack
    Creates the natural death heart item
    static org.bukkit.inventory.ItemStack
    createNextItem(int page)
    Creates a next item for paginated GUIs
    static org.bukkit.inventory.ItemStack
    Creates the withdraw heart item
    static org.bukkit.inventory.ItemStack
    Gets a skeleton skull instead of a head
    Gets the custom item data of an item
    static @Nullable String
    getCustomItemId(org.bukkit.inventory.ItemStack item)
    Gets the custom item id of an item
    static org.bukkit.inventory.ItemStack
    getPlayerHead(org.bukkit.OfflinePlayer offlinePlayer)
    Gets the head of an offline player
    static boolean
    isCustomItem(org.bukkit.inventory.ItemStack item)
    Checks if an item is a custom item (checks if it has a custom item id)
    static boolean
    isForbiddenItem(org.bukkit.inventory.ItemStack item)
    Checks if an item is a forbidden item
    static boolean
    isHeartItem(org.bukkit.inventory.ItemStack item)
    Checks if an item is a heart item
    static boolean
    isNonUsableItem(org.bukkit.inventory.ItemStack item)
    Checks if an item is a non-usable item
    static boolean
    isReviveItem(org.bukkit.inventory.ItemStack item)
    Checks if an item is a revive item

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CUSTOM_ITEM_ID_KEY

      public static final org.bukkit.NamespacedKey CUSTOM_ITEM_ID_KEY
    • CUSTOM_ITEM_TYPE_KEY

      public static final org.bukkit.NamespacedKey CUSTOM_ITEM_TYPE_KEY
    • CUSTOM_HEART_VALUE_KEY

      public static final org.bukkit.NamespacedKey CUSTOM_HEART_VALUE_KEY
    • REVIVE_PAGE_KEY

      public static final org.bukkit.NamespacedKey REVIVE_PAGE_KEY
  • Method Details

    • createCustomItem

      public static org.bukkit.inventory.ItemStack createCustomItem(String itemId)
      Creates a custom item
      Parameters:
      itemId - The id of the item
      Returns:
      The custom item
    • createCustomItem

      public static org.bukkit.inventory.ItemStack createCustomItem(String itemId, int amount)
      Creates a custom item with a specific amount
      Parameters:
      itemId - The id of the item
      amount - The amount of the item
      Returns:
      The custom item
    • createHeart

      public static org.bukkit.inventory.ItemStack createHeart()
      Creates the default heart item
      Returns:
      The default heart item
    • createWithdrawHeart

      public static org.bukkit.inventory.ItemStack createWithdrawHeart()
      Creates the withdraw heart item
      Returns:
      The withdraw heart item
    • createKillHeart

      public static org.bukkit.inventory.ItemStack createKillHeart()
      Creates the kill heart item
      Returns:
      The kill heart item
    • createNaturalDeathHeart

      public static org.bukkit.inventory.ItemStack createNaturalDeathHeart()
      Creates the natural death heart item
      Returns:
      The natural death heart item
    • createHeartGainCooldownHeart

      public static org.bukkit.inventory.ItemStack createHeartGainCooldownHeart()
      Creates the revive heart item
      Returns:
      The revive heart item
    • createMaxHealthHeart

      public static org.bukkit.inventory.ItemStack createMaxHealthHeart()
      Creates the max hearts heart item
      Returns:
      The max hearts heart item
    • createCloseItem

      public static org.bukkit.inventory.ItemStack createCloseItem()
      Creates a close item for GUIs
      Returns:
      The close item
    • createBackItem

      public static org.bukkit.inventory.ItemStack createBackItem(int page)
      Creates a back item for paginated GUIs
      Parameters:
      page - The page to go back to
      Returns:
      The back item
    • createNextItem

      public static org.bukkit.inventory.ItemStack createNextItem(int page)
      Creates a next item for paginated GUIs
      Parameters:
      page - The page to go to
      Returns:
      The next item
    • isHeartItem

      public static boolean isHeartItem(org.bukkit.inventory.ItemStack item)
      Checks if an item is a heart item
      Parameters:
      item - The item to check
      Returns:
      If the item is a heart item
    • isReviveItem

      public static boolean isReviveItem(org.bukkit.inventory.ItemStack item)
      Checks if an item is a revive item
      Parameters:
      item - The item to check
      Returns:
      If the item is a revive item
    • isForbiddenItem

      public static boolean isForbiddenItem(org.bukkit.inventory.ItemStack item)
      Checks if an item is a forbidden item
      Parameters:
      item - The item to check
      Returns:
      If the item is a forbidden item
    • isCustomItem

      public static boolean isCustomItem(org.bukkit.inventory.ItemStack item)
      Checks if an item is a custom item (checks if it has a custom item id)
      Parameters:
      item - The item to check
      Returns:
      If the item is a custom item
    • isNonUsableItem

      public static boolean isNonUsableItem(org.bukkit.inventory.ItemStack item)
      Checks if an item is a non-usable item
      Parameters:
      item - The item to check
      Returns:
      If the item is a non-usable item
    • getCustomItemId

      @Nullable public static @Nullable String getCustomItemId(org.bukkit.inventory.ItemStack item)
      Gets the custom item id of an item
      Parameters:
      item - The item to get the id from
      Returns:
      The custom item id
    • getPlayerHead

      public static org.bukkit.inventory.ItemStack getPlayerHead(org.bukkit.OfflinePlayer offlinePlayer)
      Gets the head of an offline player
      Parameters:
      offlinePlayer - The offline player
      Returns:
      The head of the player
    • getBedrockPlayerHead

      public static org.bukkit.inventory.ItemStack getBedrockPlayerHead(UUID uuid)
      Gets a skeleton skull instead of a head
      Parameters:
      uuid - The uuid of the bedrock player
      Returns:
      A skeleton skull
    • getCustomItemData

      public static CustomItemData getCustomItemData(String itemId)
      Gets the custom item data of an item
      Parameters:
      itemId - The id of the item
      Returns:
      The custom item data