2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2025-04-20 01:27:07 +00:00

fix Velocity plugin startup / shutdown issues

make sure Plugin init first and shutdown last
This commit is contained in:
mohammed jasem alaajel 2023-04-25 11:04:28 +04:00
parent 6eceec4425
commit e9b07cb03f
No known key found for this signature in database

View File

@ -34,6 +34,7 @@ import com.imaginarycode.minecraft.redisbungee.events.PlayerLeftNetworkEvent;
import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent; import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent;
import com.squareup.okhttp.Dispatcher; import com.squareup.okhttp.Dispatcher;
import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.OkHttpClient;
import com.velocitypowered.api.event.PostOrder;
import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent; import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent; import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
@ -335,13 +336,13 @@ public class RedisBungeeVelocityPlugin implements RedisBungeePlugin<Player>, Con
this.proxiesIds = this.getCurrentProxiesIds(false); this.proxiesIds = this.getCurrentProxiesIds(false);
} }
@Subscribe @Subscribe(order = PostOrder.FIRST)
public void proxyInit(ProxyInitializeEvent event) { public void onProxyInitializeEvent(ProxyInitializeEvent event) {
initialize(); initialize();
} }
@Subscribe @Subscribe(order = PostOrder.LAST)
public void proxyShutdownEvent(ProxyShutdownEvent event) { public void onProxyShutdownEvent(ProxyShutdownEvent event) {
stop(); stop();
} }