Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
EntityCombustEvent.java
1 package org.bukkit.event.entity;
2 
3 import org.bukkit.entity.Entity;
6 
7 /**
8  * Called when an entity combusts.
9  * <p>
10  * If an Entity Combust event is cancelled, the entity will not combust.
11  */
12 public class EntityCombustEvent extends EntityEvent implements Cancellable {
13  private static final HandlerList handlers = new HandlerList();
14  private int duration;
15  private boolean cancel;
16 
17  public EntityCombustEvent(final Entity combustee, final int duration) {
18  super(combustee);
19  this.duration = duration;
20  this.cancel = false;
21  }
22 
23  public boolean isCancelled() {
24  return cancel;
25  }
26 
27  public void setCancelled(boolean cancel) {
28  this.cancel = cancel;
29  }
30 
31  /**
32  * @return the amount of time (in seconds) the combustee should be alight
33  * for
34  */
35  public int getDuration() {
36  return duration;
37  }
38 
39  /**
40  * The number of seconds the combustee should be alight for.
41  * <p>
42  * This value will only ever increase the combustion time, not decrease
43  * existing combustion times.
44  *
45  * @param duration the time in seconds to be alight for.
46  */
47  public void setDuration(int duration) {
48  this.duration = duration;
49  }
50 
51  @Override
52  public HandlerList getHandlers() {
53  return handlers;
54  }
55 
56  public static HandlerList getHandlerList() {
57  return handlers;
58  }
59 }