All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bukkit.inventory.CraftingInventory Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package org.bukkit.inventory;

/**
 * Interface to the crafting inventories
 */
public interface CraftingInventory extends Inventory {

  /**
   * Check what item is in the result slot of this crafting inventory.
   *
   * @return The result item.
   */
  ItemStack getResult();

  /**
   * Set the item in the result slot of the crafting inventory.
   *
   * @param newResult The new result item.
   */
  void setResult(ItemStack newResult);

  /**
   * Get the contents of the crafting matrix.
   *
   * @return The contents.
   */
  ItemStack[] getMatrix();

  /**
   * Replace the contents of the crafting matrix
   *
   * @param contents The new contents.
   * @throws IllegalArgumentException if the length of contents is greater
   *                                  than the size of the crafting matrix.
   */
  void setMatrix(ItemStack[] contents);

  /**
   * Get the current recipe formed on the crafting inventory, if any.
   *
   * @return The recipe, or null if the current contents don't match any
   * recipe.
   */
  Recipe getRecipe();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy