Added enderdragon logging

This commit is contained in:
Admin
2011-12-08 14:45:31 +01:00
parent 2a1259fd93
commit 5a935821cf
3 changed files with 8 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import org.bukkit.block.Block;
import org.bukkit.block.Sign; import org.bukkit.block.Sign;
import org.bukkit.craftbukkit.entity.CraftEnderman; import org.bukkit.craftbukkit.entity.CraftEnderman;
import org.bukkit.entity.Creeper; import org.bukkit.entity.Creeper;
import org.bukkit.entity.EnderDragon;
import org.bukkit.entity.Enderman; import org.bukkit.entity.Enderman;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Fireball; import org.bukkit.entity.Fireball;
@@ -61,6 +62,7 @@ class LBEntityListener extends EntityListener
public void onEntityExplode(EntityExplodeEvent event) { public void onEntityExplode(EntityExplodeEvent event) {
final WorldConfig wcfg = worlds.get(event.getLocation().getWorld().getName().hashCode()); final WorldConfig wcfg = worlds.get(event.getLocation().getWorld().getName().hashCode());
if (!event.isCancelled() && wcfg != null) { if (!event.isCancelled() && wcfg != null) {
System.out.println("Explosion: " + event.getEntity().getClass().getSimpleName());
final String name; final String name;
if (event.getEntity() == null) { if (event.getEntity() == null) {
if (!wcfg.isLogging(Logging.MISCEXPLOSION)) if (!wcfg.isLogging(Logging.MISCEXPLOSION))
@@ -82,6 +84,10 @@ class LBEntityListener extends EntityListener
if (!wcfg.isLogging(Logging.GHASTFIREBALLEXPLOSION)) if (!wcfg.isLogging(Logging.GHASTFIREBALLEXPLOSION))
return; return;
name = "Ghast"; name = "Ghast";
} else if (event.getEntity() instanceof EnderDragon) {
if (!wcfg.isLogging(Logging.ENDERDRAGON))
return;
name = "EnderDragon";
} else { } else {
if (!wcfg.isLogging(Logging.MISCEXPLOSION)) if (!wcfg.isLogging(Logging.MISCEXPLOSION))
return; return;

View File

@@ -146,7 +146,7 @@ public class LogBlock extends JavaPlugin
pm.registerEvent(Type.BLOCK_FORM, lbBlockListener, Priority.Monitor, this); pm.registerEvent(Type.BLOCK_FORM, lbBlockListener, Priority.Monitor, this);
if (config.isLogging(Logging.SNOWFADE)) if (config.isLogging(Logging.SNOWFADE))
pm.registerEvent(Type.BLOCK_FADE, lbBlockListener, Priority.Monitor, this); 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); pm.registerEvent(Type.ENTITY_EXPLODE, lbEntityListener, Priority.Monitor, this);
if (config.isLogging(Logging.LEAVESDECAY)) if (config.isLogging(Logging.LEAVESDECAY))
pm.registerEvent(Type.LEAVES_DECAY, lbBlockListener, Priority.Monitor, this); pm.registerEvent(Type.LEAVES_DECAY, lbBlockListener, Priority.Monitor, this);

View File

@@ -1,7 +1,7 @@
package de.diddiz.LogBlock; package de.diddiz.LogBlock;
public enum Logging { 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; public static int length = Logging.values().length;