public interface ItemProperty
Modifier and Type | Method and Description |
---|---|
void |
apply(org.bukkit.inventory.ItemStack item,
org.bukkit.inventory.meta.ItemMeta meta,
org.bukkit.entity.Player player,
Menu menu)
Apply property to ItemStack.
|
boolean |
canReplaceMaterial()
Is this property replaces item type of given item.
|
boolean |
isApplyMeta()
Is this property allows to assign modified meta after exiting from
apply(org.bukkit.inventory.ItemStack, org.bukkit.inventory.meta.ItemMeta, org.bukkit.entity.Player, ru.abstractmenus.api.inventory.Menu) method. |
boolean canReplaceMaterial()
boolean isApplyMeta()
apply(org.bukkit.inventory.ItemStack, org.bukkit.inventory.meta.ItemMeta, org.bukkit.entity.Player, ru.abstractmenus.api.inventory.Menu)
method.
Return true if you make simple properties which modify only ItemMeta
and doesn't touches ItemStack to assign it manually.
If you set it for true and set item meta manually
inside apply(org.bukkit.inventory.ItemStack, org.bukkit.inventory.meta.ItemMeta, org.bukkit.entity.Player, ru.abstractmenus.api.inventory.Menu)
method, then all changes won't be saved.void apply(org.bukkit.inventory.ItemStack item, org.bukkit.inventory.meta.ItemMeta meta, org.bukkit.entity.Player player, Menu menu)
item
- Source ItemStack.meta
- Current meta of this item.player
- Player for who this item builds.menu
- Menu which cause item building.