Class ItemUtils

java.lang.Object
studio.magemonkey.divinity.utils.ItemUtils

public class ItemUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addEnchant(org.bukkit.inventory.ItemStack item, org.bukkit.enchantments.Enchantment e, int lvl)
     
    static void
    addFlag(org.bukkit.inventory.ItemStack item, org.bukkit.inventory.ItemFlag f)
     
    static void
    addLoreLine(org.bukkit.inventory.ItemStack item, String s, int pos)
     
    static void
    addPotionEffect(org.bukkit.inventory.ItemStack item, org.bukkit.potion.PotionEffectType type, int lvl, int dur, boolean ambient, boolean particles)
     
    static boolean
    canUse(org.bukkit.inventory.ItemStack item, org.bukkit.entity.Player player)
     
    static boolean
    canUse(org.bukkit.inventory.ItemStack item, org.bukkit.entity.Player player, boolean msg)
     
    static boolean
    checkEnchantConflict(org.bukkit.inventory.ItemStack item, org.bukkit.enchantments.Enchantment ee)
     
    static void
    clearLore(org.bukkit.inventory.ItemStack item)
     
    static boolean
    compareItemGroup(org.bukkit.inventory.ItemStack item, String group)
     
    static boolean
    compareItemGroup(org.bukkit.inventory.ItemStack item, String[] group)
     
    static void
    delFlag(org.bukkit.inventory.ItemStack item, org.bukkit.inventory.ItemFlag f)
     
    static void
    delLoreLine(org.bukkit.inventory.ItemStack item, int pos)
     
    static void
    delLoreLine(org.bukkit.inventory.ItemStack item, String s)
     
    static org.bukkit.inventory.EquipmentSlot
    getEquipmentSlotByItemType(org.bukkit.inventory.ItemStack item)
     
    static String
    getItemGroupIdFor(org.bukkit.inventory.ItemStack item)
     
    static String
    getItemGroupNameFor(org.bukkit.inventory.ItemStack item)
     
    static String
    getItemGroupNameFor(org.bukkit.Material id)
    Deprecated.
    static org.bukkit.inventory.EquipmentSlot[]
    getItemSlots(org.bukkit.inventory.ItemStack item)
     
    static String
     
    static com.mojang.authlib.GameProfile
     
    static boolean
    isArmor(org.bukkit.inventory.ItemStack item)
     
    static boolean
    isBow(org.bukkit.inventory.ItemStack item)
     
    static boolean
    isTool(org.bukkit.inventory.ItemStack item)
     
    static boolean
    isWeapon(org.bukkit.inventory.ItemStack item)
     
    static boolean
     
    static void
    setColor(org.bukkit.inventory.ItemStack item, org.bukkit.Color c)
     
    static void
    setName(org.bukkit.inventory.ItemStack item, String name)
     

    Methods inherited from class java.lang.Object

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

    • ItemUtils

      public ItemUtils()
  • Method Details

    • canUse

      public static boolean canUse(@NotNull org.bukkit.inventory.ItemStack item, @NotNull org.bukkit.entity.Player player)
    • canUse

      public static boolean canUse(@NotNull org.bukkit.inventory.ItemStack item, @NotNull org.bukkit.entity.Player player, boolean msg)
    • getEquipmentSlotByItemType

      @NotNull public static org.bukkit.inventory.EquipmentSlot getEquipmentSlotByItemType(@NotNull org.bukkit.inventory.ItemStack item)
    • getNonPlayerProfile

      public static com.mojang.authlib.GameProfile getNonPlayerProfile(String hash)
    • getItemSlots

      @NotNull public static org.bukkit.inventory.EquipmentSlot[] getItemSlots(@NotNull org.bukkit.inventory.ItemStack item)
    • getLocalizedGroupName

      @Nullable public static String getLocalizedGroupName(@NotNull String type)
    • getItemGroupNameFor

      @Deprecated @NotNull public static String getItemGroupNameFor(@NotNull org.bukkit.Material id)
      Deprecated.
      Parameters:
      id - Item material name.
      Returns:
      ItemSubType name, ItemGroup name, or localized Material name.
    • getItemGroupNameFor

      @NotNull public static String getItemGroupNameFor(@NotNull org.bukkit.inventory.ItemStack item)
      Parameters:
      item - Item to get the group name for
      Returns:
      ItemSubType name, ItemGroup name, or localized Material name.
    • getItemGroupIdFor

      @NotNull public static String getItemGroupIdFor(@NotNull org.bukkit.inventory.ItemStack item)
      Parameters:
      item - ItemStack
      Returns:
      ItemSubType id, ItemGroup id, or raw Material name.
    • compareItemGroup

      public static boolean compareItemGroup(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String group)
    • compareItemGroup

      public static boolean compareItemGroup(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String[] group)
    • parseItemGroup

      public static boolean parseItemGroup(@NotNull String group)
    • checkEnchantConflict

      public static boolean checkEnchantConflict(@NotNull org.bukkit.inventory.ItemStack item, @NotNull org.bukkit.enchantments.Enchantment ee)
    • isWeapon

      public static boolean isWeapon(@NotNull org.bukkit.inventory.ItemStack item)
    • isArmor

      public static boolean isArmor(@NotNull org.bukkit.inventory.ItemStack item)
    • isTool

      public static boolean isTool(@NotNull org.bukkit.inventory.ItemStack item)
    • isBow

      public static boolean isBow(@NotNull org.bukkit.inventory.ItemStack item)
    • addFlag

      public static void addFlag(@NotNull org.bukkit.inventory.ItemStack item, @NotNull org.bukkit.inventory.ItemFlag f)
    • delFlag

      public static void delFlag(@NotNull org.bukkit.inventory.ItemStack item, @NotNull org.bukkit.inventory.ItemFlag f)
    • setName

      public static void setName(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String name)
    • addLoreLine

      public static void addLoreLine(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String s, int pos)
    • delLoreLine

      public static void delLoreLine(@NotNull org.bukkit.inventory.ItemStack item, int pos)
    • delLoreLine

      public static void delLoreLine(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String s)
    • clearLore

      public static void clearLore(@NotNull org.bukkit.inventory.ItemStack item)
    • addEnchant

      public static void addEnchant(@NotNull org.bukkit.inventory.ItemStack item, @NotNull org.bukkit.enchantments.Enchantment e, int lvl)
    • addPotionEffect

      public static void addPotionEffect(@NotNull org.bukkit.inventory.ItemStack item, @NotNull org.bukkit.potion.PotionEffectType type, int lvl, int dur, boolean ambient, boolean particles)
    • setColor

      public static void setColor(@NotNull org.bukkit.inventory.ItemStack item, @NotNull org.bukkit.Color c)