summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Tanner <adam@adamtanner.org>2011-01-21 19:41:43 +0800
committerVictor Danell <victor.danell@gmail.com>2011-01-21 23:59:34 +0800
commitda167fe2f57c8e047c3a734613748349ee95742a (patch)
treebb789aa176f8bf022096d8a3ef8eca070fa183e4 /src
parent3306b07b8d350b9249a058b5c97519695171705e (diff)
downloadbukkit-da167fe2f57c8e047c3a734613748349ee95742a.tar
bukkit-da167fe2f57c8e047c3a734613748349ee95742a.tar.gz
bukkit-da167fe2f57c8e047c3a734613748349ee95742a.tar.lz
bukkit-da167fe2f57c8e047c3a734613748349ee95742a.tar.xz
bukkit-da167fe2f57c8e047c3a734613748349ee95742a.zip
EntityExplodeEvent keeps track of its Location.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
index ea17975d..f5874fd1 100644
--- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
@@ -4,6 +4,7 @@ package org.bukkit.event.entity;
import java.util.List;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
+import org.bukkit.Location;
import org.bukkit.event.Cancellable;
/**
@@ -12,10 +13,12 @@ import org.bukkit.event.Cancellable;
*/
public class EntityExplodeEvent extends EntityEvent implements Cancellable {
private boolean cancel;
+ private Location location;
private List blocks;
-
- public EntityExplodeEvent (Type type, Entity what, List<Block> blocks) {
+
+ public EntityExplodeEvent (Type type, Entity what, Location location, List<Block> blocks) {
super(type.ENTITY_EXPLODE, what);
+ this.location = location;
this.cancel = false;
this.blocks = blocks;
}
@@ -27,7 +30,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
-
+
/**
* Returns the list of blocks that would have been removed or were
* removed from the explosion event.
@@ -36,4 +39,13 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
return blocks;
}
+ /**
+ * Returns the location where the explosion happened.
+ * It is not possible to get this value from the Entity as
+ * the Entity no longer exists in the world.
+ */
+ public Location getLocation() {
+ return location;
+ }
+
}