Package fr.andross.banitem.items
Class BannedItem
java.lang.Object
fr.andross.banitem.items.BannedItem
- Direct Known Subclasses:
CustomBannedItem,MetaItem
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
ConstructorsConstructorDescriptionBannedItem(@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 TypeMethodDescriptionbooleanshortgetData()Possible item data attached to the item.@Nullable org.bukkit.inventory.meta.ItemMetaPossible item meta attached to the item.@Nullable org.bukkit.inventory.ItemStackPossible item built for the item.@NotNull org.bukkit.MaterialgetType()Material type of the item.inthashCode()org.bukkit.inventory.ItemStackMinecraft ItemStack representing the item.
-
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
-
hashCode
public int hashCode()
-