diff --git a/api/src/main/java/com/velocitypowered/api/proxy/ProxyServer.java b/api/src/main/java/com/velocitypowered/api/proxy/ProxyServer.java index f043b0c6..bbf999b2 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/ProxyServer.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/ProxyServer.java @@ -41,6 +41,13 @@ public interface ProxyServer extends Audience { */ void shutdown(); + /** + * Returns whether the proxy is currently shutting down. + * + * @return {@code true} if the proxy is shutting down, {@code false} otherwise + */ + boolean isShuttingDown(); + /** * Closes all listening endpoints for this server. * This includes the main minecraft listener and query channel. diff --git a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java index 45c228b3..abf2cf00 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java @@ -803,6 +803,11 @@ public class VelocityServer implements ProxyServer, ForwardingAudience { public VelocityChannelRegistrar getChannelRegistrar() { return channelRegistrar; } + + @Override + public boolean isShuttingDown() { + return shutdownInProgress.get(); + } @Override public InetSocketAddress getBoundAddress() {