Skip to content

Commit 6dd0fa7

Browse files
committed
fix(velocity): split onLoad and onEnable calls to late/early ProxyInitializeEvent handlers
1 parent 5e650c8 commit 6dd0fa7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bootstrap-velocity/src/main/java/codecrafter47/bungeetablistplus/BootstrapPlugin.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import codecrafter47.bungeetablistplus.util.VelocityPlugin;
2121
import com.google.inject.Inject;
22+
import com.velocitypowered.api.event.PostOrder;
2223
import com.velocitypowered.api.event.Subscribe;
2324
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
2425
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
@@ -75,8 +76,8 @@ public BootstrapPlugin(final ProxyServer proxy, final Logger logger, final @Data
7576
this.metricsFactory = metricsFactory;
7677
}
7778

78-
@Subscribe
79-
public void onProxyInitialization(final ProxyInitializeEvent event) {
79+
@Subscribe(order = PostOrder.EARLY)
80+
public void onProxyInitializationEarly(final ProxyInitializeEvent event) {
8081
if (Float.parseFloat(System.getProperty("java.class.version")) < 61.0) {
8182
getLogger().error("§cBungeeTabListPlus requires Java 17 or above. Please download and install it!");
8283
getLogger().error("Disabling plugin!");
@@ -88,6 +89,10 @@ public void onProxyInitialization(final ProxyInitializeEvent event) {
8889
}
8990
}
9091
BungeeTabListPlus.getInstance(this).onLoad();
92+
}
93+
94+
@Subscribe(order = PostOrder.LATE)
95+
public void onProxyInitializationLate(final ProxyInitializeEvent event) {
9196
BungeeTabListPlus.getInstance(this).onEnable();
9297
// Metrics
9398
metricsFactory.make(this, 24808);

0 commit comments

Comments
 (0)