mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-09 16:42:03 -07:00
Add getIgnitingBlock to BlockBurnEvent
By: Nathan Wolf <nathan@elmakers.com>
This commit is contained in:
@@ -13,10 +13,26 @@ import org.bukkit.event.HandlerList;
|
|||||||
public class BlockBurnEvent extends BlockEvent implements Cancellable {
|
public class BlockBurnEvent extends BlockEvent implements Cancellable {
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
|
private final Block ignitingBlock;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public BlockBurnEvent(final Block block) {
|
public BlockBurnEvent(final Block block) {
|
||||||
|
this(block, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockBurnEvent(final Block block, final Block ignitingBlock) {
|
||||||
super(block);
|
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() {
|
public boolean isCancelled() {
|
||||||
|
@@ -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.
|
* @return The Block that placed/ignited the fire block, or null if not ignited by a Block.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user