Interface ProtoItemStack
public interface ProtoItemStack
Intermediary result for an argument which parses a
Material
and optional NBT data.- Since:
- 1.5.0
-
Method Summary
Modifier and TypeMethodDescription@NonNull org.bukkit.inventory.ItemStack
createItemStack
(int stackSize, boolean respectMaximumStackSize) Create a newItemStack
from the state of thisProtoItemStack
.boolean
Get whether thisProtoItemStack
contains extra data besides theMaterial
.@NonNull org.bukkit.Material
material()
Get theMaterial
of thisProtoItemStack
.
-
Method Details
-
material
@NonNull org.bukkit.Material material()Get theMaterial
of thisProtoItemStack
.- Returns:
- the
Material
- Since:
- 1.5.0
-
hasExtraData
boolean hasExtraData()Get whether thisProtoItemStack
contains extra data besides theMaterial
.- Returns:
- whether there is extra data
- Since:
- 1.5.0
-
createItemStack
@NonNull org.bukkit.inventory.ItemStack createItemStack(int stackSize, boolean respectMaximumStackSize) throws IllegalArgumentException Create a newItemStack
from the state of thisProtoItemStack
.- Parameters:
stackSize
- stack sizerespectMaximumStackSize
- whether to respect the maximum stack size for the material- Returns:
- the created
ItemStack
- Throws:
IllegalArgumentException
- if theItemStack
could not be created, due to max stack size or other reasons- Since:
- 1.5.0
-