Added logging of Locked Chest decay

This commit is contained in:
Marcos Vives Del Sol
2013-09-26 13:16:22 +02:00
parent 044863bc3d
commit aa09891f21
3 changed files with 28 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import de.diddiz.LogBlock.listeners.FluidFlowLogging;
import de.diddiz.LogBlock.listeners.InteractLogging;
import de.diddiz.LogBlock.listeners.KillLogging;
import de.diddiz.LogBlock.listeners.LeavesDecayLogging;
import de.diddiz.LogBlock.listeners.LockedChestDecayLogging;
import de.diddiz.LogBlock.listeners.PlayerInfoLogging;
import de.diddiz.LogBlock.listeners.SignChangeLogging;
import de.diddiz.LogBlock.listeners.SnowFadeLogging;
@ -187,6 +188,8 @@ public class LogBlock extends JavaPlugin
pm.registerEvents(new StructureGrowLogging(this), this);
if (isLogging(Logging.GRASSGROWTH) || isLogging(Logging.MYCELIUMSPREAD) || isLogging(Logging.VINEGROWTH) || isLogging(Logging.MUSHROOMSPREAD))
pm.registerEvents(new BlockSpreadLogging(this), this);
if (isLogging(Logging.LOCKEDCHESTDECAY))
pm.registerEvents(new LockedChestDecayLogging(this), this);
if (logPlayerInfo)
pm.registerEvents(new PlayerInfoLogging(this), this);
}

View File

@ -9,7 +9,7 @@ public enum Logging
PRESUREPLATEINTERACT, TRIPWIREINTERACT, CREATURECROPTRAMPLE, CROPTRAMPLE,
NATURALSTRUCTUREGROW, GRASSGROWTH, MYCELIUMSPREAD, VINEGROWTH, MUSHROOMSPREAD,
WITHER(true), WITHER_SKULL(true), BONEMEALSTRUCTUREGROW,
WORLDEDIT, TNTMINECARTEXPLOSION(true);
WORLDEDIT, TNTMINECARTEXPLOSION(true), LOCKEDCHESTDECAY;
public static final int length = Logging.values().length;
private final boolean defaultEnabled;

View File

@ -0,0 +1,24 @@
package de.diddiz.LogBlock.listeners;
import static de.diddiz.LogBlock.config.Config.isLogging;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockFadeEvent;
import de.diddiz.LogBlock.LogBlock;
import de.diddiz.LogBlock.Logging;
public class LockedChestDecayLogging extends LoggingListener
{
public LockedChestDecayLogging(LogBlock lb) {
super(lb);
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event) {
if (isLogging(event.getBlock().getWorld(), Logging.LOCKEDCHESTDECAY)) {
final int type = event.getBlock().getTypeId();
if (type == 95)
consumer.queueBlockReplace("LockedChestDecay", event.getBlock().getState(), event.getNewState());
}
}
}