Class ItemUtils

java.lang.Object
me.despical.commons.item.ItemUtils

public class ItemUtils extends Object
Author:
Despical

Created at 30.05.2020

  • Field Summary

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

    Modifier and Type
    Method
    Description
    static org.bukkit.inventory.ItemStack
     
    static boolean
    isNamed(org.bukkit.inventory.ItemStack stack)
     
    static boolean
    isSameItems(org.bukkit.inventory.ItemStack first, org.bukkit.inventory.ItemStack second)
    Checks if the given 2 items have the same display name, lore and amount.
    static boolean
    isSameItemsWithoutAmount(org.bukkit.inventory.ItemStack first, org.bukkit.inventory.ItemStack second)
    Checks if the given 2 items have the same display name and lore.
    static org.bukkit.inventory.meta.SkullMeta
    setPlayerHead(org.bukkit.entity.Player player, org.bukkit.inventory.meta.SkullMeta meta)
     

    Methods inherited from class java.lang.Object

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

    • PLAYER_HEAD_ITEM

      public static final org.bukkit.inventory.ItemStack PLAYER_HEAD_ITEM
  • Method Details

    • isNamed

      public static boolean isNamed(org.bukkit.inventory.ItemStack stack)
    • isSameItems

      public static boolean isSameItems(org.bukkit.inventory.ItemStack first, org.bukkit.inventory.ItemStack second)
      Checks if the given 2 items have the same display name, lore and amount.
      Parameters:
      first - the first item to check
      second - the second item to check
      Returns:
      true if the given 2 items are equals and both are same amount, otherwise false
    • isSameItemsWithoutAmount

      public static boolean isSameItemsWithoutAmount(org.bukkit.inventory.ItemStack first, org.bukkit.inventory.ItemStack second)
      Checks if the given 2 items have the same display name and lore.
      Parameters:
      first - the first item to check
      second - the second item to check
      Returns:
      true if the given 2 items are equals, may not be same amount
    • getSkull

      public static org.bukkit.inventory.ItemStack getSkull(String url)
    • setPlayerHead

      public static org.bukkit.inventory.meta.SkullMeta setPlayerHead(org.bukkit.entity.Player player, org.bukkit.inventory.meta.SkullMeta meta)