Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PrepareItemCraftEvent.java
1 package org.bukkit.event.inventory;
2 
7 
8 public class PrepareItemCraftEvent extends InventoryEvent {
9  private static final HandlerList handlers = new HandlerList();
10  private boolean repair;
11  private CraftingInventory matrix;
12 
14  super(view);
15  this.matrix = what;
16  this.repair = isRepair;
17  }
18 
19  /**
20  * Get the recipe that has been formed. If this event was triggered by a
21  * tool repair, this will be a temporary shapeless recipe representing the
22  * repair.
23  *
24  * @return The recipe being crafted.
25  */
26  public Recipe getRecipe() {
27  return matrix.getRecipe();
28  }
29 
30  /**
31  * @return The crafting inventory on which the recipe was formed.
32  */
33  @Override
35  return matrix;
36  }
37 
38  /**
39  * Check if this event was triggered by a tool repair operation rather
40  * than a crafting recipe.
41  *
42  * @return True if this is a repair.
43  */
44  public boolean isRepair() {
45  return repair;
46  }
47 
48  @Override
49  public HandlerList getHandlers() {
50  return handlers;
51  }
52 
53  public static HandlerList getHandlerList() {
54  return handlers;
55  }
56 }