org.bukkit.inventory
Interface CraftingInventory

All Superinterfaces:
Inventory, Iterable<ItemStack>

public interface CraftingInventory
extends Inventory

Interface to the crafting inventories


Method Summary
 ItemStack[] getMatrix()
          Get the contents of the crafting matrix.
 Recipe getRecipe()
          Get the current recipe formed on the crafting inventory, if any.
 ItemStack getResult()
          Check what item is in the result slot of this crafting inventory.
 void setMatrix(ItemStack[] contents)
          Replace the contents of the crafting matrix
 void setResult(ItemStack newResult)
          Set the item in the result slot of the crafting inventory.
 
Methods inherited from interface org.bukkit.inventory.Inventory
addItem, all, all, all, clear, clear, contains, contains, contains, contains, contains, contains, containsAtLeast, first, first, first, firstEmpty, getContents, getHolder, getItem, getMaxStackSize, getName, getSize, getTitle, getType, getViewers, iterator, iterator, remove, remove, remove, removeItem, setContents, setItem, setMaxStackSize
 

Method Detail

getResult

ItemStack getResult()
Check what item is in the result slot of this crafting inventory.

Returns:
The result item.

getMatrix

ItemStack[] getMatrix()
Get the contents of the crafting matrix.

Returns:
The contents.

setResult

void setResult(ItemStack newResult)
Set the item in the result slot of the crafting inventory.

Parameters:
newResult - The new result item.

setMatrix

void setMatrix(ItemStack[] contents)
Replace the contents of the crafting matrix

Parameters:
contents - The new contents.
Throws:
IllegalArgumentException - if the length of contents is greater than the size of the crafting matrix.

getRecipe

Recipe 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.


Copyright © 2013. All Rights Reserved.