mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-01 06:33:35 +01:00
Makes only authenticated players chat recipients that will be filtered
This commit is contained in:
parent
30cdf6b1e0
commit
fc87ea4eef
@ -57,15 +57,19 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
* @param event AsyncPlayerChatEvent
|
* @param event AsyncPlayerChatEvent
|
||||||
*/
|
*/
|
||||||
private void handleChat(AsyncPlayerChatEvent event) {
|
private void handleChat(AsyncPlayerChatEvent event) {
|
||||||
if (Settings.isChatAllowed || Utils.checkAuth(event.getPlayer())) {
|
if (Settings.isChatAllowed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
for (Player p : Utils.getOnlinePlayers()) {
|
|
||||||
if (!PlayerCache.getInstance().isAuthenticated(p.getName())) {
|
if(Utils.checkAuth(player)) {
|
||||||
event.getRecipients().remove(p); // TODO: it should be configurable
|
for (Player p : Utils.getOnlinePlayers()) {
|
||||||
|
if (!PlayerCache.getInstance().isAuthenticated(p.getName())) {
|
||||||
|
event.getRecipients().remove(p); // TODO: it should be configurable
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user