mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-10-16 23:35:02 +02:00
Fix for #386
This commit is contained in:
parent
8fec53eda3
commit
2de077e71b
@ -222,7 +222,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onPreLogin(AsyncPlayerPreLoginEvent event) {
|
public void onPreLogin(AsyncPlayerPreLoginEvent event) {
|
||||||
PlayerAuth auth = plugin.database.getAuth(event.getName());
|
PlayerAuth auth = plugin.database.getAuth(event.getName());
|
||||||
if (auth != null && !auth.getRealName().equals("Player") && !auth.getRealName().equals(event.getName())) {
|
if (auth != null && auth.getRealName() != null && !auth.getRealName().isEmpty() && !auth.getRealName().equals("Player") && !auth.getRealName().equals(event.getName())) {
|
||||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
||||||
event.setKickMessage("You should join using username: " + ChatColor.AQUA + auth.getRealName() +
|
event.setKickMessage("You should join using username: " + ChatColor.AQUA + auth.getRealName() +
|
||||||
ChatColor.RESET + "\nnot: " + ChatColor.RED + event.getName()); // TODO: write a better message
|
ChatColor.RESET + "\nnot: " + ChatColor.RED + event.getName()); // TODO: write a better message
|
||||||
|
Loading…
Reference in New Issue
Block a user