Class CyberItemUtils

java.lang.Object
com.github.cyberryan1.cybercore.spigot.utils.CyberItemUtils

public final class CyberItemUtils extends Object
Item utilities
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.inventory.ItemStack
    addAttributes(org.bukkit.inventory.ItemStack item, String attributeName, double amount, org.bukkit.attribute.Attribute attribute, boolean hideFlags)
    Adds an attribute to an item
    static org.bukkit.inventory.ItemStack
    addItemFlags(org.bukkit.inventory.ItemStack item, org.bukkit.inventory.ItemFlag... flags)
    Adds a list of item flags to an item
    static org.bukkit.inventory.ItemStack
    addItemLore(org.bukkit.inventory.ItemStack item, String... lore)
    Adds the provided lines to the lore of an item
    static org.bukkit.inventory.ItemStack
    createItem(org.bukkit.Material material, String name)
    Creates an item from the given material and name
    static org.bukkit.inventory.ItemStack
    getPlayerSkull(org.bukkit.OfflinePlayer player)
    Returns the skull of the given player
    static org.bukkit.inventory.ItemStack
    removeAttributes(org.bukkit.inventory.ItemStack item, String attributeName, double amount, org.bukkit.attribute.Attribute attribute, boolean hideFlags)
    Removes an attribute from an item
    static org.bukkit.inventory.ItemStack
    removeItemFlags(org.bukkit.inventory.ItemStack item, org.bukkit.inventory.ItemFlag... flags)
    Removes a list of item flags from an item
    static org.bukkit.inventory.ItemStack
    setItemLore(org.bukkit.inventory.ItemStack item, String... lore)
    Sets the lore of an item
    static org.bukkit.inventory.ItemStack
    setItemLore(org.bukkit.inventory.ItemStack item, List<String> lore)
    Sets the lore of an item
    static org.bukkit.inventory.ItemStack
    setItemName(org.bukkit.inventory.ItemStack item, String name)
    Sets the name of an item

    Methods inherited from class java.lang.Object

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

    • CyberItemUtils

      public CyberItemUtils()
  • Method Details

    • setItemLore

      public static org.bukkit.inventory.ItemStack setItemLore(org.bukkit.inventory.ItemStack item, List<String> lore)
      Sets the lore of an item
      Parameters:
      item - The item to set the lore of
      lore - The lore to set the item to
      Returns:
      The item with the lore set
    • setItemLore

      public static org.bukkit.inventory.ItemStack setItemLore(org.bukkit.inventory.ItemStack item, String... lore)
      Sets the lore of an item
      Parameters:
      item - The item to set the lore of
      lore - The lore to set the item to
      Returns:
      The item with the lore set
    • addItemLore

      public static org.bukkit.inventory.ItemStack addItemLore(org.bukkit.inventory.ItemStack item, String... lore)
      Adds the provided lines to the lore of an item
      Parameters:
      item - The item to add the lore to
      lore - The lore to add to the item
      Returns:
      The item with the lore added
    • setItemName

      public static org.bukkit.inventory.ItemStack setItemName(org.bukkit.inventory.ItemStack item, String name)
      Sets the name of an item
      Parameters:
      item - The item to set the name of
      name - The name to set the item to
      Returns:
      The item with the name set
    • createItem

      public static org.bukkit.inventory.ItemStack createItem(org.bukkit.Material material, String name)
      Creates an item from the given material and name
      Parameters:
      material - The material of the item
      name - The name of the item
      Returns:
      The created item
    • addAttributes

      public static org.bukkit.inventory.ItemStack addAttributes(org.bukkit.inventory.ItemStack item, String attributeName, double amount, org.bukkit.attribute.Attribute attribute, boolean hideFlags)
      Adds an attribute to an item
      Parameters:
      item - The item to add the attribute to
      attributeName - The name of the attribute to add
      amount - The amount of the attribute to add
      attribute - The Attribute to add
      hideFlags - Whether to add the ItemFlag.HIDE_ATTRIBUTES flag to the item
      Returns:
      The item with the attribute added
    • removeAttributes

      public static org.bukkit.inventory.ItemStack removeAttributes(org.bukkit.inventory.ItemStack item, String attributeName, double amount, org.bukkit.attribute.Attribute attribute, boolean hideFlags)
      Removes an attribute from an item
      Parameters:
      item - The item to remove the attribute from
      attributeName - The name of the attribute to add
      amount - The amount of the attribute to add
      attribute - The Attribute to remove
      hideFlags - Whether to add the ItemFlag.HIDE_ATTRIBUTES flag to the item
      Returns:
      The item with the attribute removed
    • addItemFlags

      public static org.bukkit.inventory.ItemStack addItemFlags(org.bukkit.inventory.ItemStack item, org.bukkit.inventory.ItemFlag... flags)
      Adds a list of item flags to an item
      Parameters:
      item - The item to add the flags to
      flags - A list of ItemFlag to add to the item
      Returns:
      The item with the flags added
    • removeItemFlags

      public static org.bukkit.inventory.ItemStack removeItemFlags(org.bukkit.inventory.ItemStack item, org.bukkit.inventory.ItemFlag... flags)
      Removes a list of item flags from an item
      Parameters:
      item - The item to remove the flags from
      flags - A list of ItemFlag to remove from the item
      Returns:
      The item with the flags removed
    • getPlayerSkull

      public static org.bukkit.inventory.ItemStack getPlayerSkull(org.bukkit.OfflinePlayer player)
      Returns the skull of the given player
      Parameters:
      player - The player to get the skull of
      Returns:
      The skull of the player