1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-06 14:46:32 +02:00

Log notice when chat ignore is blocked by another plugin.

This commit is contained in:
KHobbits
2013-07-17 23:26:26 +01:00
parent 25b7a91ced
commit fd6257355f
2 changed files with 44 additions and 28 deletions

View File

@@ -69,6 +69,8 @@ public class EssentialsPlayerListener implements Listener
user.sendMessage(_("voiceSilenced")); user.sendMessage(_("voiceSilenced"));
LOGGER.info(_("mutedUserSpeaks", user.getName())); LOGGER.info(_("mutedUserSpeaks", user.getName()));
} }
try
{
final Iterator<Player> it = event.getRecipients().iterator(); final Iterator<Player> it = event.getRecipients().iterator();
while (it.hasNext()) while (it.hasNext())
{ {
@@ -78,6 +80,19 @@ public class EssentialsPlayerListener implements Listener
it.remove(); it.remove();
} }
} }
}
catch (UnsupportedOperationException ex)
{
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "Ignore could not block chat due to custom chat plugin event.", ex);
}
else
{
ess.getLogger().info("Ignore could not block chat due to custom chat plugin event.");
}
}
user.updateActivity(true); user.updateActivity(true);
user.setDisplayNick(); user.setDisplayNick();
} }

View File

@@ -9,6 +9,7 @@ import java.util.Iterator;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.logging.Level;
import net.ess3.api.events.LocalChatSpyEvent; import net.ess3.api.events.LocalChatSpyEvent;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Server; import org.bukkit.Server;
@@ -93,7 +94,7 @@ public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer
{ {
if (ess.getSettings().isDebug()) if (ess.getSettings().isDebug())
{ {
ess.getLogger().info("Plugin triggered custom chat event, local chat handling aborted."); ess.getLogger().log(Level.INFO, "Plugin triggered custom chat event, local chat handling aborted.", ex);
} }
return; return;
} }