From 0286900829f73d9d9dd47d189fb1371d52bb605f Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 20 Nov 2010 11:53:57 -0800 Subject: [PATCH] The notify, log, and tell actions will now trigger every time for the on-break, on-create, on-drop events. --- src/BlacklistEntry.java | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/BlacklistEntry.java b/src/BlacklistEntry.java index 7bb9b052..3dea1bcb 100644 --- a/src/BlacklistEntry.java +++ b/src/BlacklistEntry.java @@ -292,7 +292,7 @@ public void tell(String itemName) { } }; - return process(block.getType(), player, destroyActions, handler); + return process(block.getType(), player, destroyActions, handler, false); } /** @@ -329,7 +329,7 @@ public void tell(String itemName) { } }; - return process(block.getType(), player, breakActions, handler); + return process(block.getType(), player, breakActions, handler, true); } /** @@ -365,7 +365,7 @@ public void tell(String itemName) { } }; - return process(item, player, destroyWithActions, handler); + return process(item, player, destroyWithActions, handler, false); } /** @@ -401,7 +401,7 @@ public void tell(String itemName) { } }; - return process(item, player, createActions, handler); + return process(item, player, createActions, handler, true); } /** @@ -437,7 +437,7 @@ public void tell(String itemName) { } }; - return process(block.getType(), player, useActions, handler); + return process(block.getType(), player, useActions, handler, false); } /** @@ -465,7 +465,7 @@ public void tell(String itemName) { } }; - return process(block.getType(), player, useActions, handler); + return process(block.getType(), player, useActions, handler, false); } /** @@ -501,7 +501,7 @@ public void tell(String itemName) { } }; - return process(item, player, dropActions, handler); + return process(item, player, dropActions, handler, true); } /** @@ -510,9 +510,13 @@ public void tell(String itemName) { * @param id * @param player * @param actions + * @param handler + * @param allowRepeat * @return */ - private boolean process(int id, Player player, String[] actions, ActionHandler handler) { + private boolean process(int id, Player player, String[] actions, + ActionHandler handler, boolean allowRepeat) { + if (shouldIgnore(player)) { return true; } @@ -560,7 +564,7 @@ private boolean process(int id, Player player, String[] actions, ActionHandler h handler.ban(etc.getDataSource().getItem(id)); } - } else if (!repeating) { + } else if (!repeating || allowRepeat) { // Notify if (action.equalsIgnoreCase("notify")) { handler.notifyAdmins(etc.getDataSource().getItem(id)); @@ -570,7 +574,7 @@ private boolean process(int id, Player player, String[] actions, ActionHandler h handler.log(etc.getDataSource().getItem(id)); // Tell - } else if (!repeating && action.equalsIgnoreCase("tell")) { + } else if (action.equalsIgnoreCase("tell")) { if (this.message != null) { player.sendMessage(Colors.Yellow + String.format(message, etc.getDataSource().getItem(id))