forked from LogBlock/LogBlock
Fix fire spread logging
This commit is contained in:
@@ -10,6 +10,8 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.block.BlockBurnEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import static de.diddiz.LogBlock.config.Config.isLogging;
|
||||
@@ -29,6 +31,29 @@ public class BlockBurnLogging extends LoggingListener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onBlockIgnite(BlockIgniteEvent event) {
|
||||
Actor actor = new Actor("Fire");
|
||||
if (event.getCause() == IgniteCause.FLINT_AND_STEEL) {
|
||||
if(event.getIgnitingEntity() != null) {
|
||||
return; // handled in block place
|
||||
} else {
|
||||
actor = new Actor("Dispenser");
|
||||
}
|
||||
} else if(event.getCause() == IgniteCause.LIGHTNING) {
|
||||
actor = new Actor("Lightning");
|
||||
} else if(event.getCause() == IgniteCause.EXPLOSION) {
|
||||
actor = new Actor("Explosion");
|
||||
} else if(event.getCause() == IgniteCause.LAVA) {
|
||||
actor = new Actor("Lava");
|
||||
} else if(event.getCause() == IgniteCause.ENDER_CRYSTAL) {
|
||||
actor = new Actor("EnderCrystal");
|
||||
}
|
||||
if (isLogging(event.getBlock().getWorld(), Logging.FIRE)) {
|
||||
consumer.queueBlockPlace(actor, event.getBlock().getLocation(), Material.FIRE.createBlockData());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onExtinguish(PlayerInteractEvent event) {
|
||||
if (event.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
|
||||
|
Reference in New Issue
Block a user