Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
ExplosionPrimeEvent.java
1 package org.bukkit.event.entity;
2 
3 import org.bukkit.entity.Entity;
7 
8 /**
9  * Called when an entity has made a decision to explode.
10  */
11 public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  private boolean cancel;
14  private float radius;
15  private boolean fire;
16 
17  public ExplosionPrimeEvent(final Entity what, final float radius, final boolean fire) {
18  super(what);
19  this.cancel = false;
20  this.radius = radius;
21  this.fire = fire;
22  }
23 
24  public ExplosionPrimeEvent(final Explosive explosive) {
25  this(explosive, explosive.getYield(), explosive.isIncendiary());
26  }
27 
28  public boolean isCancelled() {
29  return cancel;
30  }
31 
32  public void setCancelled(boolean cancel) {
33  this.cancel = cancel;
34  }
35 
36  /**
37  * Gets the radius of the explosion
38  *
39  * @return returns the radius of the explosion
40  */
41  public float getRadius() {
42  return radius;
43  }
44 
45  /**
46  * Sets the radius of the explosion
47  *
48  * @param radius the radius of the explosion
49  */
50  public void setRadius(float radius) {
51  this.radius = radius;
52  }
53 
54  /**
55  * Gets whether this explosion will create fire or not
56  *
57  * @return true if this explosion will create fire
58  */
59  public boolean getFire() {
60  return fire;
61  }
62 
63  /**
64  * Sets whether this explosion will create fire or not
65  *
66  * @param fire true if you want this explosion to create fire
67  */
68  public void setFire(boolean fire) {
69  this.fire = fire;
70  }
71 
72  @Override
73  public HandlerList getHandlers() {
74  return handlers;
75  }
76 
77  public static HandlerList getHandlerList() {
78  return handlers;
79  }
80 }