From 217c93b86ba1e1ceb5319493177b6b9e067b1efc Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Wed, 8 Mar 2017 14:19:47 -0800 Subject: [PATCH] Add getIgnitingBlock to BlockBurnEvent By: Nathan Wolf --- .../org/bukkit/event/block/BlockBurnEvent.java | 18 +++++++++++++++++- .../bukkit/event/block/BlockIgniteEvent.java | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockBurnEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockBurnEvent.java index 1592a158db..e7934d2a42 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockBurnEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockBurnEvent.java @@ -13,10 +13,26 @@ import org.bukkit.event.HandlerList; public class BlockBurnEvent extends BlockEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private boolean cancelled; + private final Block ignitingBlock; + @Deprecated public BlockBurnEvent(final Block block) { + this(block, null); + } + + public BlockBurnEvent(final Block block, final Block ignitingBlock) { super(block); - this.cancelled = false; + this.ignitingBlock = ignitingBlock; + } + + /** + * Gets the block which ignited this block. + * + * @return The Block that ignited and burned this block, or null if no + * source block exists + */ + public Block getIgnitingBlock() { + return ignitingBlock; } public boolean isCancelled() { diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java index 3c85866e43..b7435608f4 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java @@ -75,7 +75,7 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable { } /** - * Gets the block who ignited this block + * Gets the block which ignited this block * * @return The Block that placed/ignited the fire block, or null if not ignited by a Block. */