This commit is contained in:
samczsun 2017-03-09 20:12:22 -05:00 committed by cnr
parent ca452463db
commit 40648cf715

View File

@ -205,22 +205,6 @@ public class Chat extends MiniPlugin
return true;
}
@EventHandler
public void removeChat(AsyncPlayerChatEvent event)
{
if (event.isCancelled())
return;
if (event.isAsynchronous())
{
for (Iterator<Player> playerIterator = event.getRecipients().iterator(); playerIterator.hasNext();)
{
if (!_preferences.get(playerIterator.next()).isActive(Preference.SHOW_CHAT))
playerIterator.remove();
}
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onSignChange(SignChangeEvent event)
{
@ -403,6 +387,11 @@ public class Chat extends MiniPlugin
return;
}
}
if (event.isAsynchronous())
{
event.getRecipients().removeIf(player -> !_preferences.get(player).isActive(Preference.SHOW_CHAT));
}
}
private boolean msgContainsHack(String msg)