mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-19 00:35:20 +01:00
Merge branch 'master' of https://github.com/AuthMe-Team/AuthMeReloaded into enums
This commit is contained in:
commit
0065a6a827
@ -57,11 +57,17 @@ public class AuthMePlayerListener implements Listener {
|
||||
* @param event AsyncPlayerChatEvent
|
||||
*/
|
||||
private void handleChat(AsyncPlayerChatEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
for (Player p : Utils.getOnlinePlayers()) {
|
||||
if (p != player && !PlayerCache.getInstance().isAuthenticated(p.getName())) {
|
||||
event.getRecipients().remove(p);
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.isChatAllowed) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
if (Utils.checkAuth(player)) {
|
||||
return;
|
||||
}
|
||||
@ -214,7 +220,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
if (event.getPlayer() == null) {
|
||||
if (event.getPlayer() == null || Utils.isNPC(event.getPlayer())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -250,7 +256,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
public void onPreLogin(AsyncPlayerPreLoginEvent event) {
|
||||
final String name = event.getName().toLowerCase();
|
||||
final Player player = Utils.getPlayer(name);
|
||||
if (player == null) {
|
||||
if (player == null || Utils.isNPC(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ public final class Utils {
|
||||
|
||||
// TODO: Move to a Manager
|
||||
public static boolean checkAuth(Player player) {
|
||||
if (player == null || Utils.isUnrestricted(player)) {
|
||||
if (player == null || Utils.isUnrestricted(player) || Utils.isNPC(player)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user