From e9b07cb03f66b53ac064ec5fa3c82ed5cc228d9a Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel Date: Tue, 25 Apr 2023 11:04:28 +0400 Subject: [PATCH] fix Velocity plugin startup / shutdown issues make sure Plugin init first and shutdown last --- .../minecraft/redisbungee/RedisBungeeVelocityPlugin.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/RedisBungee-Velocity/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeVelocityPlugin.java b/RedisBungee-Velocity/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeVelocityPlugin.java index 454e2c7..ca9355d 100644 --- a/RedisBungee-Velocity/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeVelocityPlugin.java +++ b/RedisBungee-Velocity/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeVelocityPlugin.java @@ -34,6 +34,7 @@ import com.imaginarycode.minecraft.redisbungee.events.PlayerLeftNetworkEvent; import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent; import com.squareup.okhttp.Dispatcher; import com.squareup.okhttp.OkHttpClient; +import com.velocitypowered.api.event.PostOrder; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.proxy.ProxyInitializeEvent; import com.velocitypowered.api.event.proxy.ProxyShutdownEvent; @@ -335,13 +336,13 @@ public class RedisBungeeVelocityPlugin implements RedisBungeePlugin, Con this.proxiesIds = this.getCurrentProxiesIds(false); } - @Subscribe - public void proxyInit(ProxyInitializeEvent event) { + @Subscribe(order = PostOrder.FIRST) + public void onProxyInitializeEvent(ProxyInitializeEvent event) { initialize(); } - @Subscribe - public void proxyShutdownEvent(ProxyShutdownEvent event) { + @Subscribe(order = PostOrder.LAST) + public void onProxyShutdownEvent(ProxyShutdownEvent event) { stop(); }