From 64fbbf759fe66e3699b1f3e79831ac4612872f5d Mon Sep 17 00:00:00 2001 From: juanmuscaria Date: Fri, 17 Sep 2021 09:45:09 -0300 Subject: [PATCH] Actually handle proxy shutdown this time --- .../games647/fastlogin/velocity/FastLoginVelocity.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/velocity/src/main/java/com/github/games647/fastlogin/velocity/FastLoginVelocity.java b/velocity/src/main/java/com/github/games647/fastlogin/velocity/FastLoginVelocity.java index 05d5bc0e..15e7beea 100644 --- a/velocity/src/main/java/com/github/games647/fastlogin/velocity/FastLoginVelocity.java +++ b/velocity/src/main/java/com/github/games647/fastlogin/velocity/FastLoginVelocity.java @@ -40,6 +40,7 @@ import com.google.inject.Inject; import com.velocitypowered.api.command.CommandSource; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.proxy.ProxyInitializeEvent; +import com.velocitypowered.api.event.proxy.ProxyShutdownEvent; import com.velocitypowered.api.plugin.Plugin; import com.velocitypowered.api.plugin.annotation.DataDirectory; import com.velocitypowered.api.proxy.Player; @@ -99,6 +100,13 @@ public class FastLoginVelocity implements PlatformPlugin { server.getEventManager().register(this, new PluginMessageListener(this)); } + @Subscribe + public void onProxyShutdown(ProxyShutdownEvent event) { + if (core != null) { + core.close(); + } + } + @Override public String getName() { return PomData.NAME;