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 TypeMethodDescriptionboolean
short
getData()
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
getType()
Material type of the item.int
hashCode()
org.bukkit.inventory.ItemStack
Minecraft 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()
-