Added tripwire & pressure plate logging

This commit is contained in:
Dark Arc
2013-03-29 20:36:17 -04:00
parent 05c9a6d947
commit 16cdb1c58b
4 changed files with 19 additions and 3 deletions

View File

@@ -76,6 +76,10 @@ public class BlockChange implements LookupCacheElement
msg.append("ate a piece of ").append(materialName(type)); msg.append("ate a piece of ").append(materialName(type));
else if (type == 25 || type == 93 || type == 94 || type == 149 || type == 150) else if (type == 25 || type == 93 || type == 94 || type == 149 || type == 150)
msg.append("changed ").append(materialName(type)); msg.append("changed ").append(materialName(type));
else if (type == 70 || type == 72 || type == 147 || type == 148)
msg.append("stepped on ").append(materialName(type));
else if (type == 132)
msg.append("ran into ").append(materialName(type));
} else if (type == 0) } else if (type == 0)
msg.append("destroyed ").append(materialName(replaced, data)); msg.append("destroyed ").append(materialName(replaced, data));
else if (replaced == 0) else if (replaced == 0)

View File

@@ -149,7 +149,7 @@ public class LogBlock extends JavaPlugin
if (isLogging(Logging.CHESTACCESS)) { if (isLogging(Logging.CHESTACCESS)) {
pm.registerEvents(new ChestAccessLogging(this), this); pm.registerEvents(new ChestAccessLogging(this), this);
} }
if (isLogging(Logging.SWITCHINTERACT) || isLogging(Logging.DOORINTERACT) || isLogging(Logging.CAKEEAT) || isLogging(Logging.DIODEINTERACT) || isLogging(Logging.COMPARATORINTERACT) || isLogging(Logging.NOTEBLOCKINTERACT)) if (isLogging(Logging.SWITCHINTERACT) || isLogging(Logging.DOORINTERACT) || isLogging(Logging.CAKEEAT) || isLogging(Logging.DIODEINTERACT) || isLogging(Logging.COMPARATORINTERACT) || isLogging(Logging.NOTEBLOCKINTERACT) || isLogging(Logging.PRESUREPLATEINTERACT) || isLogging(Logging.TRIPWIREINTERACT))
pm.registerEvents(new InteractLogging(this), this); pm.registerEvents(new InteractLogging(this), this);
if (isLogging(Logging.KILL)) if (isLogging(Logging.KILL))
pm.registerEvents(new KillLogging(this), this); pm.registerEvents(new KillLogging(this), this);

View File

@@ -6,9 +6,8 @@ public enum Logging
GHASTFIREBALLEXPLOSION(true), ENDERDRAGON(true), MISCEXPLOSION, FIRE(true), LEAVESDECAY, GHASTFIREBALLEXPLOSION(true), ENDERDRAGON(true), MISCEXPLOSION, FIRE(true), LEAVESDECAY,
LAVAFLOW, WATERFLOW, CHESTACCESS, KILL, CHAT, SNOWFORM, SNOWFADE, DOORINTERACT, LAVAFLOW, WATERFLOW, CHESTACCESS, KILL, CHAT, SNOWFORM, SNOWFADE, DOORINTERACT,
SWITCHINTERACT, CAKEEAT, ENDERMEN, NOTEBLOCKINTERACT, DIODEINTERACT, COMPARATORINTERACT, SWITCHINTERACT, CAKEEAT, ENDERMEN, NOTEBLOCKINTERACT, DIODEINTERACT, COMPARATORINTERACT,
NATURALSTRUCTUREGROW, WITHER(true), WITHER_SKULL(true), PRESUREPLATEINTERACT, TRIPWIREINTERACT, NATURALSTRUCTUREGROW, WITHER(true), WITHER_SKULL(true),
BONEMEALSTRUCTUREGROW, WORLDEDIT, TNTMINECARTEXPLOSION(true); BONEMEALSTRUCTUREGROW, WORLDEDIT, TNTMINECARTEXPLOSION(true);
public static final int length = Logging.values().length; public static final int length = Logging.values().length;
private final boolean defaultEnabled; private final boolean defaultEnabled;

View File

@@ -60,6 +60,19 @@ public class InteractLogging extends LoggingListener
consumer.queueBlock(player.getName(), loc, typeId, typeId, blockData); consumer.queueBlock(player.getName(), loc, typeId, typeId, blockData);
} }
break; break;
case WOOD_PLATE:
case STONE_PLATE:
case IRON_PLATE:
case GOLD_PLATE:
if (wcfg.isLogging(Logging.PRESUREPLATEINTERACT) && event.getAction() == Action.PHYSICAL) {
consumer.queueBlock(player.getName(), loc, typeId, typeId, blockData);
}
break;
case TRIPWIRE:
if (wcfg.isLogging(Logging.TRIPWIREINTERACT) && event.getAction() == Action.PHYSICAL) {
consumer.queueBlock(player.getName(), loc, typeId, typeId, blockData);
}
break;
} }
} }
} }