Class BannedItem

java.lang.Object
fr.andross.banitem.items.BannedItem
Direct Known Subclasses:
CustomBannedItem, MetaItem

public class BannedItem extends Object
An item wrapper, which can handle matching Material/ItemStacks with their ItemMeta and not considering the amount.
Version:
3.1.1
Author:
Andross
  • Constructor Summary

    Constructors
    Constructor
    Description
    BannedItem(@NotNull org.bukkit.Material material)
    Create a banned item without metadata.
    BannedItem(@NotNull org.bukkit.inventory.ItemStack item)
    Create a banned item including the ItemMeta of the item.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    short
    Possible item data attached to the item.
    @Nullable org.bukkit.inventory.meta.ItemMeta
    Possible item meta attached to the item.
    @Nullable org.bukkit.inventory.ItemStack
    Possible item built for the item.
    @NotNull org.bukkit.Material
    Material type of the item.
    int
     
    org.bukkit.inventory.ItemStack
    Minecraft ItemStack representing the item.

    Methods inherited from class java.lang.Object

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

    • BannedItem

      public BannedItem(@NotNull @NotNull org.bukkit.Material material)
      Create a banned item without metadata.
      Parameters:
      material - material
    • BannedItem

      public BannedItem(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Create a banned item including the ItemMeta of the item.
      Parameters:
      item - item stack
  • Method Details

    • getType

      @NotNull public @NotNull org.bukkit.Material getType()
      Material type of the item.
      Returns:
      the material of the item
    • getItemMeta

      @Nullable public @Nullable org.bukkit.inventory.meta.ItemMeta getItemMeta()
      Possible item meta attached to the item.
      Returns:
      the item meta
    • getData

      public short getData()
      Possible item data attached to the item.
      Returns:
      the item data, ignored after 1.13+
    • getItemStack

      @Nullable public @Nullable org.bukkit.inventory.ItemStack getItemStack()
      Possible item built for the item.
      Returns:
      possible item built for the item.
    • toItemStack

      public org.bukkit.inventory.ItemStack toItemStack()
      Minecraft ItemStack representing the item.
      Returns:
      an ItemStack representing the item
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object