diff --git a/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java b/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java index 03342f1d..25940491 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java +++ b/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java @@ -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 * diff --git a/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java b/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java index 334a208c..8da8409c 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java +++ b/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java @@ -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);