Merge pull request #10 from DaJokni/main

fix commands being executed if player wasnt successfully on the server
This commit is contained in:
FeuSalamander 2023-05-11 14:46:24 +02:00 committed by GitHub
commit 003ff97a95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();