fix commands being executed if player wasnt successfully on the server

This commit is contained in:
DaJokni 2023-05-10 19:51:20 +03:00
parent 75da02bd26
commit 8d532ecdae

View File

@ -51,6 +51,11 @@ public final class Listeners {
if (!configuration.isLeaveEnabled()) { if (!configuration.isLeaveEnabled()) {
return; return;
} }
if (!e.getLoginStatus().equals(DisconnectEvent.LoginStatus.SUCCESSFUL_LOGIN)){
return;
}
if(!configuration.getLeavecmd().isEmpty())for(String s : configuration.getLeavecmd()){proxyServer.getCommandManager().executeAsync(proxyServer.getConsoleCommandSource(), s);} if(!configuration.getLeavecmd().isEmpty())for(String s : configuration.getLeavecmd()){proxyServer.getCommandManager().executeAsync(proxyServer.getConsoleCommandSource(), s);}
final Player p = e.getPlayer(); final Player p = e.getPlayer();
final Optional<ServerConnection> server = p.getCurrentServer(); final Optional<ServerConnection> server = p.getCurrentServer();