mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-24 03:05:17 +01:00
Iterate over all chat recipients
This commit is contained in:
parent
dd5fb49065
commit
11350ec43a
@ -129,7 +129,6 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
sendLoginOrRegisterMessage(event.getPlayer());
|
sendLoginOrRegisterMessage(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOW)
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOW)
|
||||||
public void onPlayerChat(PlayerChatEvent event) {
|
public void onPlayerChat(PlayerChatEvent event) {
|
||||||
if (settings.getProperty(RestrictionSettings.ALLOW_CHAT)) {
|
if (settings.getProperty(RestrictionSettings.ALLOW_CHAT)) {
|
||||||
@ -148,9 +147,9 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
} else if (settings.getProperty(RestrictionSettings.HIDE_CHAT)) {
|
} else if (settings.getProperty(RestrictionSettings.HIDE_CHAT)) {
|
||||||
Set<Player> recipients = event.getRecipients();
|
Set<Player> recipients = event.getRecipients();
|
||||||
Iterator<Player> iter = recipients.iterator();
|
Iterator<Player> iter = recipients.iterator();
|
||||||
if(iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
Player p = iter.next();
|
Player p = iter.next();
|
||||||
if(PlayerCache.getInstance().isAuthenticated(p.getName())) {
|
if (PlayerCache.getInstance().isAuthenticated(p.getName())) {
|
||||||
iter.remove();
|
iter.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user