From 8d532ecdae34b4072c863a0b943c7a44f076b4cd Mon Sep 17 00:00:00 2001 From: DaJokni <56400974+DaJokni@users.noreply.github.com> Date: Wed, 10 May 2023 19:51:20 +0300 Subject: [PATCH] fix commands being executed if player wasnt successfully on the server --- src/main/java/me/feusalamander/vmessage/Listeners.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/me/feusalamander/vmessage/Listeners.java b/src/main/java/me/feusalamander/vmessage/Listeners.java index 5ce039c..1ba1247 100644 --- a/src/main/java/me/feusalamander/vmessage/Listeners.java +++ b/src/main/java/me/feusalamander/vmessage/Listeners.java @@ -51,6 +51,11 @@ public final class Listeners { if (!configuration.isLeaveEnabled()) { 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);} final Player p = e.getPlayer(); final Optional server = p.getCurrentServer();