From 8feccf30cc428c7b4ee5bee04176d5b9717f17b7 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Wed, 7 Dec 2011 23:56:15 +1100 Subject: [PATCH] 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. By: Andrew Ardill --- .../bukkit/event/entity/EntityExplodeEvent.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java index df727961a2..9701a8a0df 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java +++ b/paper-api/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() {