Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
FurnaceBurnEvent.java
1 package org.bukkit.event.inventory;
2 
3 import org.bukkit.block.Block;
8 
9 /**
10  * Called when an ItemStack is successfully burned as fuel in a furnace.
11  */
12 public class FurnaceBurnEvent extends BlockEvent implements Cancellable {
13  private static final HandlerList handlers = new HandlerList();
14  private final ItemStack fuel;
15  private int burnTime;
16  private boolean cancelled;
17  private boolean burning;
18 
19  public FurnaceBurnEvent(final Block furnace, final ItemStack fuel, final int burnTime) {
20  super(furnace);
21  this.fuel = fuel;
22  this.burnTime = burnTime;
23  this.cancelled = false;
24  this.burning = true;
25  }
26 
27  /**
28  * Gets the block for the furnace involved in this event
29  *
30  * @return the block of the furnace
31  * @deprecated In favour of {@link #getBlock()}.
32  */
33  @Deprecated
34  public Block getFurnace() {
35  return getBlock();
36  }
37 
38  /**
39  * Gets the fuel ItemStack for this event
40  *
41  * @return the fuel ItemStack
42  */
43  public ItemStack getFuel() {
44  return fuel;
45  }
46 
47  /**
48  * Gets the burn time for this fuel
49  *
50  * @return the burn time for this fuel
51  */
52  public int getBurnTime() {
53  return burnTime;
54  }
55 
56  /**
57  * Sets the burn time for this fuel
58  *
59  * @param burnTime the burn time for this fuel
60  */
61  public void setBurnTime(int burnTime) {
62  this.burnTime = burnTime;
63  }
64 
65  /**
66  * Gets whether the furnace's fuel is burning or not.
67  *
68  * @return whether the furnace's fuel is burning or not.
69  */
70  public boolean isBurning() {
71  return this.burning;
72  }
73 
74  /**
75  * Sets whether the furnace's fuel is burning or not.
76  *
77  * @param burning true if the furnace's fuel is burning
78  */
79  public void setBurning(boolean burning) {
80  this.burning = burning;
81  }
82 
83  public boolean isCancelled() {
84  return cancelled;
85  }
86 
87  public void setCancelled(boolean cancel) {
88  this.cancelled = cancel;
89  }
90 
91  @Override
92  public HandlerList getHandlers() {
93  return handlers;
94  }
95 
96  public static HandlerList getHandlerList() {
97  return handlers;
98  }
99 }