Class ItemUtils

java.lang.Object
net.apartium.cocoabeans.spigot.inventory.ItemUtils

public class ItemUtils extends Object
Various utils for working with item stacks
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    getInternalName(org.bukkit.Material material)
    Returns the internal name of the material For 1.8, it will be Enum.name() For 1.13+, it will be Material.getKey()
    static boolean
    isAirOrNull(org.bukkit.inventory.ItemStack item)
    Check if given item stack is air or is null
    static boolean
    isArmor(org.bukkit.inventory.ItemStack item)
    Check if given item stack is an armor piece

    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

    • isArmor

      public static boolean isArmor(org.bukkit.inventory.ItemStack item)
      Check if given item stack is an armor piece
      Parameters:
      item - item stack
      Returns:
      true if armor piece, else false
    • isAirOrNull

      public static boolean isAirOrNull(org.bukkit.inventory.ItemStack item)
      Check if given item stack is air or is null
      Parameters:
      item - given item stack
      Returns:
      true if air or null, else false
    • getInternalName

      @AvailableSince("0.0.30") public static String getInternalName(org.bukkit.Material material)
      Returns the internal name of the material For 1.8, it will be Enum.name() For 1.13+, it will be Material.getKey()
      Parameters:
      material - material to get the internal name of
      Returns:
      internal name of the material