diff --git a/src/de/diddiz/LogBlock/LBEntityListener.java b/src/de/diddiz/LogBlock/LBEntityListener.java index 130824d..bced872 100644 --- a/src/de/diddiz/LogBlock/LBEntityListener.java +++ b/src/de/diddiz/LogBlock/LBEntityListener.java @@ -7,6 +7,7 @@ import org.bukkit.block.Block; import org.bukkit.block.Sign; import org.bukkit.craftbukkit.entity.CraftEnderman; import org.bukkit.entity.Creeper; +import org.bukkit.entity.EnderDragon; import org.bukkit.entity.Enderman; import org.bukkit.entity.Entity; import org.bukkit.entity.Fireball; @@ -61,6 +62,7 @@ class LBEntityListener extends EntityListener public void onEntityExplode(EntityExplodeEvent event) { final WorldConfig wcfg = worlds.get(event.getLocation().getWorld().getName().hashCode()); if (!event.isCancelled() && wcfg != null) { + System.out.println("Explosion: " + event.getEntity().getClass().getSimpleName()); final String name; if (event.getEntity() == null) { if (!wcfg.isLogging(Logging.MISCEXPLOSION)) @@ -82,6 +84,10 @@ class LBEntityListener extends EntityListener if (!wcfg.isLogging(Logging.GHASTFIREBALLEXPLOSION)) return; name = "Ghast"; + } else if (event.getEntity() instanceof EnderDragon) { + if (!wcfg.isLogging(Logging.ENDERDRAGON)) + return; + name = "EnderDragon"; } else { if (!wcfg.isLogging(Logging.MISCEXPLOSION)) return; diff --git a/src/de/diddiz/LogBlock/LogBlock.java b/src/de/diddiz/LogBlock/LogBlock.java index 1e6a260..4439ffa 100644 --- a/src/de/diddiz/LogBlock/LogBlock.java +++ b/src/de/diddiz/LogBlock/LogBlock.java @@ -146,7 +146,7 @@ public class LogBlock extends JavaPlugin pm.registerEvent(Type.BLOCK_FORM, lbBlockListener, Priority.Monitor, this); if (config.isLogging(Logging.SNOWFADE)) pm.registerEvent(Type.BLOCK_FADE, lbBlockListener, Priority.Monitor, this); - if (config.isLogging(Logging.CREEPEREXPLOSION) || config.isLogging(Logging.TNTEXPLOSION) || config.isLogging(Logging.GHASTFIREBALLEXPLOSION) || config.isLogging(Logging.MISCEXPLOSION)) + if (config.isLogging(Logging.CREEPEREXPLOSION) || config.isLogging(Logging.TNTEXPLOSION) || config.isLogging(Logging.GHASTFIREBALLEXPLOSION) || config.isLogging(Logging.ENDERDRAGON) || config.isLogging(Logging.MISCEXPLOSION)) pm.registerEvent(Type.ENTITY_EXPLODE, lbEntityListener, Priority.Monitor, this); if (config.isLogging(Logging.LEAVESDECAY)) pm.registerEvent(Type.LEAVES_DECAY, lbBlockListener, Priority.Monitor, this); diff --git a/src/de/diddiz/LogBlock/Logging.java b/src/de/diddiz/LogBlock/Logging.java index 08e1f5c..4fe8340 100644 --- a/src/de/diddiz/LogBlock/Logging.java +++ b/src/de/diddiz/LogBlock/Logging.java @@ -1,7 +1,7 @@ package de.diddiz.LogBlock; public enum Logging { - BLOCKPLACE(true), BLOCKBREAK(true), SIGNTEXT, TNTEXPLOSION(true), CREEPEREXPLOSION(true), GHASTFIREBALLEXPLOSION(true), MISCEXPLOSION, FIRE(true), LEAVESDECAY, LAVAFLOW, WATERFLOW, CHESTACCESS, KILL, CHAT, SNOWFORM, SNOWFADE, DOORINTERACT, SWITCHINTERACT, CAKEEAT, ENDERMEN, NOTEBLOCKINTERACT, DIODEINTERACT; + BLOCKPLACE(true), BLOCKBREAK(true), SIGNTEXT, TNTEXPLOSION(true), CREEPEREXPLOSION(true), GHASTFIREBALLEXPLOSION(true), ENDERDRAGON(true), MISCEXPLOSION, FIRE(true), LEAVESDECAY, LAVAFLOW, WATERFLOW, CHESTACCESS, KILL, CHAT, SNOWFORM, SNOWFADE, DOORINTERACT, SWITCHINTERACT, CAKEEAT, ENDERMEN, NOTEBLOCKINTERACT, DIODEINTERACT; public static int length = Logging.values().length;