Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
FurnaceSmeltEvent.java
1 package org.bukkit.event.inventory;
2 
3 import org.bukkit.block.Block;
8 
9 /**
10  * Called when an ItemStack is successfully smelted in a furnace.
11  */
12 public class FurnaceSmeltEvent extends BlockEvent implements Cancellable {
13  private static final HandlerList handlers = new HandlerList();
14  private final ItemStack source;
15  private ItemStack result;
16  private boolean cancelled;
17 
18  public FurnaceSmeltEvent(final Block furnace, final ItemStack source, final ItemStack result) {
19  super(furnace);
20  this.source = source;
21  this.result = result;
22  this.cancelled = false;
23  }
24 
25  /**
26  * Gets the block for the furnace involved in this event
27  *
28  * @return the block of the furnace
29  * @deprecated In favour of {@link #getBlock()}.
30  */
31  @Deprecated
32  public Block getFurnace() {
33  return getBlock();
34  }
35 
36  /**
37  * Gets the smelted ItemStack for this event
38  *
39  * @return smelting source ItemStack
40  */
41  public ItemStack getSource() {
42  return source;
43  }
44 
45  /**
46  * Gets the resultant ItemStack for this event
47  *
48  * @return smelting result ItemStack
49  */
50  public ItemStack getResult() {
51  return result;
52  }
53 
54  /**
55  * Sets the resultant ItemStack for this event
56  *
57  * @param result new result ItemStack
58  */
59  public void setResult(ItemStack result) {
60  this.result = result;
61  }
62 
63  public boolean isCancelled() {
64  return cancelled;
65  }
66 
67  public void setCancelled(boolean cancel) {
68  this.cancelled = cancel;
69  }
70 
71  @Override
72  public HandlerList getHandlers() {
73  return handlers;
74  }
75 
76  public static HandlerList getHandlerList() {
77  return handlers;
78  }
79 }