mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-24 03:25:24 +01:00
Updated burn event handling.
This commit is contained in:
parent
b379b8f022
commit
ef7d487ec5
@ -175,8 +175,7 @@ public void onBlockIgnite(BlockIgniteEvent event) {
|
||||
Block block = event.getBlock();
|
||||
//Player player = event.getPlayer();
|
||||
World world = block.getWorld();
|
||||
boolean isFireSpread = cause == IgniteCause.SLOW_SPREAD
|
||||
|| cause == IgniteCause.SPREAD;
|
||||
boolean isFireSpread = cause == IgniteCause.SPREAD;
|
||||
|
||||
if (plugin.preventLavaFire && cause == IgniteCause.LAVA) {
|
||||
event.setCancelled(true);
|
||||
@ -247,6 +246,33 @@ public void onBlockIgnite(BlockIgniteEvent event) {
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a block is destroyed from burning
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockBurn(BlockBurnEvent event) {
|
||||
if (plugin.disableFireSpread) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.fireSpreadDisableToggle) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.disableFireSpreadBlocks.size() > 0) {
|
||||
Block block = event.getBlock();
|
||||
World world = block.getWorld();
|
||||
|
||||
if (plugin.disableFireSpreadBlocks.contains(block.getTypeId())) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when block physics occurs
|
||||
*
|
||||
|
@ -183,6 +183,7 @@ private void registerEvents() {
|
||||
registerEvent(Event.Type.BLOCK_INTERACT, blockListener, Priority.High);
|
||||
registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.High);
|
||||
registerEvent(Event.Type.BLOCK_RIGHTCLICKED, blockListener, Priority.High);
|
||||
registerEvent(Event.Type.BLOCK_BURN, blockListener, Priority.High);
|
||||
registerEvent(Event.Type.REDSTONE_CHANGE, blockListener, Priority.High);
|
||||
|
||||
registerEvent(Event.Type.ENTITY_DAMAGED, entityListener, Priority.High);
|
||||
|
Loading…
Reference in New Issue
Block a user