Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.inventory.CraftingInventory Interface Reference

Interface to the crafting inventories. More...

+ Inheritance diagram for org.bukkit.inventory.CraftingInventory:
+ Collaboration diagram for org.bukkit.inventory.CraftingInventory:

Public Member Functions

ItemStack getResult ()
 Check what item is in the result slot of this crafting inventory.
 
ItemStack[] getMatrix ()
 Get the contents of the crafting matrix.
 
void setResult (ItemStack newResult)
 Set the item in the result slot of the crafting inventory.
 
void setMatrix (ItemStack[] contents)
 Replace the contents of the crafting matrix.
 
Recipe getRecipe ()
 Get the current recipe formed on the crafting inventory, if any.
 
- Public Member Functions inherited from org.bukkit.inventory.Inventory
int getSize ()
 Returns the size of the inventory.
 
int getMaxStackSize ()
 Returns the maximum stack size for an ItemStack in this inventory.
 
void setMaxStackSize (int size)
 This method allows you to change the maximum stack size for an inventory.
 
String getName ()
 Returns the name of the inventory.
 
ItemStack getItem (int index)
 Returns the ItemStack found in the slot at the given index.
 
void setItem (int index, ItemStack item)
 Stores the ItemStack at the given index of the inventory.
 
HashMap< Integer, ItemStackaddItem (ItemStack...items) throws IllegalArgumentException
 Stores the given ItemStacks in the inventory.
 
HashMap< Integer, ItemStackremoveItem (ItemStack...items) throws IllegalArgumentException
 Removes the given ItemStacks from the inventory.
 
ItemStack[] getContents ()
 Returns all ItemStacks from the inventory.
 
void setContents (ItemStack[] items) throws IllegalArgumentException
 Completely replaces the inventory's contents.
 
boolean contains (int materialId)
 Checks if the inventory contains any ItemStacks with the given materialId.
 
boolean contains (Material material) throws IllegalArgumentException
 Checks if the inventory contains any ItemStacks with the given material.
 
boolean contains (ItemStack item)
 Checks if the inventory contains any ItemStacks matching the given ItemStack.
 
boolean contains (int materialId, int amount)
 Checks if the inventory contains any ItemStacks with the given materialId, adding to at least the minimum amount specified.
 
boolean contains (Material material, int amount) throws IllegalArgumentException
 Checks if the inventory contains any ItemStacks with the given material, adding to at least the minimum amount specified.
 
boolean contains (ItemStack item, int amount)
 Checks if the inventory contains any ItemStacks matching the given ItemStack and at least the minimum amount specified This will only match if both the type and the amount of the stack match.
 
boolean containsAtLeast (ItemStack item, int amount)
 Returns a HashMap with all slots and ItemStacks in the inventory with given materialId.
 
HashMap< Integer,?extends
ItemStack
all (int materialId)
 Find all slots in the inventory containing any ItemStacks with the given materialId.
 
HashMap< Integer,?extends
ItemStack
all (Material material) throws IllegalArgumentException
 Returns a HashMap with all slots and ItemStacks in the inventory with the given Material.
 
HashMap< Integer,?extends
ItemStack
all (ItemStack item)
 Finds all slots in the inventory containing any ItemStacks with the given ItemStack This will only match slots if both the type and the amount of the stack match.
 
int first (int materialId)
 Finds the first slot in the inventory containing an ItemStack with the given materialId.
 
int first (Material material) throws IllegalArgumentException
 Finds the first slot in the inventory containing an ItemStack with the given material.
 
int first (ItemStack item)
 Returns the first slot in the inventory containing an ItemStack with the given stack This will only match a slot if both the type and the amount of the stack match.
 
int firstEmpty ()
 Returns the first empty Slot.
 
void remove (int materialId)
 Removes all stacks in the inventory matching the given materialId.
 
void remove (Material material) throws IllegalArgumentException
 Removes all stacks in the inventory matching the given material.
 
void remove (ItemStack item)
 Removes all stacks in the inventory matching the given stack.
 
void clear (int index)
 Clears out a particular slot in the index.
 
void clear ()
 Clears out the whole Inventory.
 
List< HumanEntitygetViewers ()
 Gets a list of players viewing.
 
String getTitle ()
 Returns the title of this inventory.
 
InventoryType getType ()
 Returns what type of inventory this is.
 
InventoryHolder getHolder ()
 Gets the block or entity belonging to the open inventory.
 
ListIterator< ItemStackiterator ()
 
ListIterator< ItemStackiterator (int index)
 Returns an iterator starting at the given index.
 

Detailed Description

Interface to the crafting inventories.

Definition at line 6 of file CraftingInventory.java.

Member Function Documentation

ItemStack [] org.bukkit.inventory.CraftingInventory.getMatrix ( )

Get the contents of the crafting matrix.

Returns
The contents.
Recipe org.bukkit.inventory.CraftingInventory.getRecipe ( )

Get the current recipe formed on the crafting inventory, if any.

Returns
The recipe, or null if the current contents don't match any recipe.

Referenced by org.bukkit.event.inventory.PrepareItemCraftEvent.getRecipe().

ItemStack org.bukkit.inventory.CraftingInventory.getResult ( )

Check what item is in the result slot of this crafting inventory.

Returns
The result item.
void org.bukkit.inventory.CraftingInventory.setMatrix ( ItemStack[]  contents)

Replace the contents of the crafting matrix.

Parameters
contentsThe new contents.
Exceptions
IllegalArgumentExceptionif the length of contents is greater than the size of the crafting matrix.
void org.bukkit.inventory.CraftingInventory.setResult ( ItemStack  newResult)

Set the item in the result slot of the crafting inventory.

Parameters
newResultThe new result item.

The documentation for this interface was generated from the following file: