Fixed various cast exceptions with the blacklist loggers.

This commit is contained in:
sk89q 2011-01-20 11:16:59 -08:00
parent abbced0530
commit a8cd832c28
3 changed files with 5 additions and 5 deletions

View File

@ -56,8 +56,8 @@ public void logEvent(BlacklistEvent event, String comment) {
+ (comment != null ? " (" + comment + ")" : ""));
// Block interact
} else if (event instanceof BlockPlaceBlacklistEvent) {
BlockPlaceBlacklistEvent evt = (BlockPlaceBlacklistEvent)event;
} else if (event instanceof BlockInteractBlacklistEvent) {
BlockInteractBlacklistEvent evt = (BlockInteractBlacklistEvent)event;
logger.log(Level.INFO, "WorldGuard: " + event.getPlayer().getName()
+ " tried to interact with " + getFriendlyItemName(evt.getType())
+ (comment != null ? " (" + comment + ")" : ""));

View File

@ -172,7 +172,7 @@ public void logEvent(BlacklistEvent event, String comment) {
// Use
} else if (event instanceof ItemUseBlacklistEvent) {
ItemDropBlacklistEvent evt = (ItemDropBlacklistEvent)event;
ItemUseBlacklistEvent evt = (ItemUseBlacklistEvent)event;
logEvent("USE", evt.getPlayer(), evt.getPlayer().getPosition(),
evt.getType(), comment);

View File

@ -255,12 +255,12 @@ public void logEvent(BlacklistEvent event, String comment) {
// Drop
} else if (event instanceof ItemDropBlacklistEvent) {
ItemAcquireBlacklistEvent evt = (ItemAcquireBlacklistEvent)event;
ItemDropBlacklistEvent evt = (ItemDropBlacklistEvent)event;
logEvent(event, "drop", evt.getType(), evt.getPosition(), comment);
// Use
} else if (event instanceof ItemUseBlacklistEvent) {
ItemDropBlacklistEvent evt = (ItemDropBlacklistEvent)event;
ItemUseBlacklistEvent evt = (ItemUseBlacklistEvent)event;
logEvent(event, "use", evt.getType(), evt.getPosition(), comment);
// Unknown