|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ItemFactory
An instance of the ItemFactory can be obtained with Server.getItemFactory().
The ItemFactory is solely responsible for creating item meta containers to apply on item stacks.
| Method Summary | |
|---|---|
ItemMeta |
asMetaFor(ItemMeta meta,
ItemStack stack)
Returns an appropriate item meta for the specified stack. |
ItemMeta |
asMetaFor(ItemMeta meta,
Material material)
Returns an appropriate item meta for the specified material. |
boolean |
equals(ItemMeta meta1,
ItemMeta meta2)
This method is used to compare two item meta data objects. |
Color |
getDefaultLeatherColor()
Returns the default color for all leather armor. |
ItemMeta |
getItemMeta(Material material)
This creates a new item meta for the material. |
boolean |
isApplicable(ItemMeta meta,
ItemStack stack)
This method checks the item meta to confirm that it is applicable (no data lost if applied) to the specified ItemStack. |
boolean |
isApplicable(ItemMeta meta,
Material material)
This method checks the item meta to confirm that it is applicable (no data lost if applied) to the specified Material. |
| Method Detail |
|---|
ItemMeta getItemMeta(Material material)
material - The material to consider as base for the meta
boolean isApplicable(ItemMeta meta,
ItemStack stack)
throws IllegalArgumentException
SkullMeta would not be valid for a sword, but a normal ItemMeta from an enchanted dirt block would.
meta - Meta to checkstack - Item that meta will be applied to
IllegalArgumentException - if the meta was not created by this factory
boolean isApplicable(ItemMeta meta,
Material material)
throws IllegalArgumentException
SkullMeta would not be valid for a sword, but a normal ItemMeta from an enchanted dirt block would.
meta - Meta to checkmaterial - Material that meta will be applied to
IllegalArgumentException - if the meta was not created by this factory
boolean equals(ItemMeta meta1,
ItemMeta meta2)
throws IllegalArgumentException
meta1 - First meta to compare, and may be null to indicate no datameta2 - Second meta to compare, and may be null to indicate no data
IllegalArgumentException - if either meta was not created by this factory
ItemMeta asMetaFor(ItemMeta meta,
ItemStack stack)
throws IllegalArgumentException
SkullMeta is being applied to a book, this method would return a BookMeta containing all
information in the specified meta that is applicable to an ItemMeta, the highest common interface.
meta - the meta to convertstack - the stack to convert the meta for
IllegalArgumentException - if the specified meta was not created by this factory
ItemMeta asMetaFor(ItemMeta meta,
Material material)
throws IllegalArgumentException
SkullMeta is being applied to a book, this method would return a BookMeta containing all
information in the specified meta that is applicable to an ItemMeta, the highest common interface.
meta - the meta to convertmaterial - the material to convert the meta for
IllegalArgumentException - if the specified meta was not created by this factoryColor getDefaultLeatherColor()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||