forked from LogBlock/LogBlock
Added enderdragon logging
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user