From 56f4e89e06b3ddd6a3e2acddbbd1371a7e9f7c3c Mon Sep 17 00:00:00 2001 From: Andrew Ardill Date: Wed, 7 Dec 2011 23:56:15 +1100 Subject: 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. --- .../java/org/bukkit/event/entity/EntityExplodeEvent.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/main') 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 blocks; - private float yield = 0.3F; + private float yield; + @Deprecated public EntityExplodeEvent(Entity what, Location location, List blocks) { + this(what, location, blocks, 0.3F); + } + + public EntityExplodeEvent(Entity what, Location location, List 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() { -- cgit v1.2.3