summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorAndrew Ardill <andrew.ardill@gmail.com>2011-12-07 23:56:15 +1100
committerAndrew Ardill <andrew.ardill@gmail.com>2011-12-07 23:56:15 +1100
commit56f4e89e06b3ddd6a3e2acddbbd1371a7e9f7c3c (patch)
tree936d951aad7bbef0a14153ad8e62d3c9ba619f80 /src/main
parentdb33bcd1e49facf2f316cdf68b827480a6876b19 (diff)
downloadbukkit-56f4e89e06b3ddd6a3e2acddbbd1371a7e9f7c3c.tar
bukkit-56f4e89e06b3ddd6a3e2acddbbd1371a7e9f7c3c.tar.gz
bukkit-56f4e89e06b3ddd6a3e2acddbbd1371a7e9f7c3c.tar.lz
bukkit-56f4e89e06b3ddd6a3e2acddbbd1371a7e9f7c3c.tar.xz
bukkit-56f4e89e06b3ddd6a3e2acddbbd1371a7e9f7c3c.zip
EntityExplodeEvent: Add constructor that takes yeild parameter
The Ender Dragon causes blocks to explode as it flies through them. These blocks by default do not drop any items, so the default yeild for this explosion event is 0. Previously the event had the default value hard-coded to 0.3F, which is inaccurate in this situation. We derecate the constructor with no yield, as any default yield should really be left up to the implementation to decide, not the API.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
index df727961..9701a8a0 100644
--- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
@@ -1,11 +1,12 @@
package org.bukkit.event.entity;
-import java.util.List;
+import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
-import org.bukkit.Location;
import org.bukkit.event.Cancellable;
+import java.util.List;
+
/**
* Called when an entity explodes
*/
@@ -13,13 +14,19 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
private boolean cancel;
private Location location;
private List<Block> blocks;
- private float yield = 0.3F;
+ private float yield;
+ @Deprecated
public EntityExplodeEvent(Entity what, Location location, List<Block> blocks) {
+ this(what, location, blocks, 0.3F);
+ }
+
+ public EntityExplodeEvent(Entity what, Location location, List<Block> blocks, float yield) {
super(Type.ENTITY_EXPLODE, what);
this.location = location;
- this.cancel = false;
this.blocks = blocks;
+ this.yield = yield;
+ this.cancel = false;
}
public boolean isCancelled() {