Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 69 lines 1.6 kB view raw
1package org.bukkit.event.entity; 2 3import org.bukkit.entity.Entity; 4import org.bukkit.entity.Explosive; 5import org.bukkit.event.Cancellable; 6 7/** 8 * Called when an entity has made a decision to explode. 9 */ 10public class ExplosionPrimeEvent extends EntityEvent implements Cancellable { 11 private boolean cancel; 12 private float radius; 13 private boolean fire; 14 15 public ExplosionPrimeEvent(Entity what, float radius, boolean fire) { 16 super(Type.EXPLOSION_PRIME, what); 17 this.cancel = false; 18 this.radius = radius; 19 this.fire = fire; 20 } 21 22 public ExplosionPrimeEvent(Explosive explosive) { 23 this(explosive, explosive.getYield(), explosive.isIncendiary()); 24 } 25 26 public boolean isCancelled() { 27 return cancel; 28 } 29 30 public void setCancelled(boolean cancel) { 31 this.cancel = cancel; 32 } 33 34 /** 35 * Gets the radius of the explosion 36 * 37 * @return returns the radius of the explosion 38 */ 39 public float getRadius() { 40 return radius; 41 } 42 43 /** 44 * Sets the radius of the explosion 45 * 46 * @param radius the radius of the explosion 47 */ 48 public void setRadius(float radius) { 49 this.radius = radius; 50 } 51 52 /** 53 * Gets whether this explosion will create fire or not 54 * 55 * @return true if this explosion will create fire 56 */ 57 public boolean getFire() { 58 return fire; 59 } 60 61 /** 62 * Sets whether this explosion will create fire or not 63 * 64 * @param fire true if you want this explosion to create fire 65 */ 66 public void setFire(boolean fire) { 67 this.fire = fire; 68 } 69}