001 package org.bukkit.inventory; 002 003 /** 004 * Interface to the crafting inventories 005 */ 006 public interface CraftingInventory extends Inventory { 007 008 /** 009 * Check what item is in the result slot of this crafting inventory. 010 * 011 * @return The result item. 012 */ 013 ItemStack getResult(); 014 015 /** 016 * Get the contents of the crafting matrix. 017 * 018 * @return The contents. 019 */ 020 ItemStack[] getMatrix(); 021 022 /** 023 * Set the item in the result slot of the crafting inventory. 024 * 025 * @param newResult The new result item. 026 */ 027 void setResult(ItemStack newResult); 028 029 /** 030 * Replace the contents of the crafting matrix 031 * 032 * @param contents The new contents. 033 * @throws IllegalArgumentException if the length of contents is greater 034 * than the size of the crafting matrix. 035 */ 036 void setMatrix(ItemStack[] contents); 037 038 /** 039 * Get the current recipe formed on the crafting inventory, if any. 040 * 041 * @return The recipe, or null if the current contents don't match any 042 * recipe. 043 */ 044 Recipe getRecipe(); 045 }