BlockBurnEvent
This commit is contained in:
parent
8e927a84bb
commit
b2efe28122
@ -275,6 +275,13 @@ public abstract class Event {
|
|||||||
*/
|
*/
|
||||||
BLOCK_INTERACT (Category.BLOCK),
|
BLOCK_INTERACT (Category.BLOCK),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a block is destroyed from being burnt by fire
|
||||||
|
*
|
||||||
|
* @see org.bukkit.event.block.BlockBurnEvent
|
||||||
|
*/
|
||||||
|
BLOCK_BURN (Category.BLOCK),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when leaves are decaying naturally
|
* Called when leaves are decaying naturally
|
||||||
*
|
*
|
||||||
|
31
src/main/java/org/bukkit/event/block/BlockBurnEvent.java
Normal file
31
src/main/java/org/bukkit/event/block/BlockBurnEvent.java
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
|
||||||
|
package org.bukkit.event.block;
|
||||||
|
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a block is destroyed because of being burnt by fire
|
||||||
|
* @author tkelly
|
||||||
|
*/
|
||||||
|
public class BlockBurnEvent extends BlockEvent implements Cancellable {
|
||||||
|
private boolean cancelled;
|
||||||
|
|
||||||
|
public BlockBurnEvent(Block block) {
|
||||||
|
super(Type.BLOCK_BURN, block);
|
||||||
|
this.cancelled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow for the block to be stopped from being destroyed
|
||||||
|
* @param cancel
|
||||||
|
*/
|
||||||
|
public void setCancelled(boolean cancel) {
|
||||||
|
this.cancelled = cancel;
|
||||||
|
}
|
||||||
|
}
|
@ -94,4 +94,12 @@ public class BlockListener implements Listener {
|
|||||||
public void onLeavesDecay(LeavesDecayEvent event) {
|
public void onLeavesDecay(LeavesDecayEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a block is destroyed from burning
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
|
public void onBlockBurn(BlockBurnEvent event) {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -191,6 +191,9 @@ public final class JavaPluginLoader implements PluginLoader {
|
|||||||
case REDSTONE_CHANGE:
|
case REDSTONE_CHANGE:
|
||||||
trueListener.onBlockRedstoneChange((BlockFromToEvent)event);
|
trueListener.onBlockRedstoneChange((BlockFromToEvent)event);
|
||||||
break;
|
break;
|
||||||
|
case BLOCK_BURN:
|
||||||
|
trueListener.onBlockBurn((BlockBurnEvent)event);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else if(listener instanceof ServerListener) {
|
} else if(listener instanceof ServerListener) {
|
||||||
ServerListener trueListener = (ServerListener)listener;
|
ServerListener trueListener = (ServerListener)listener;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user