Skip to content

Commit 3f99cc5

Browse files
committed
Move this to proxy start instead of construct
1 parent 8a97647 commit 3f99cc5

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

velocity/src/main/java/com/github/fernthedev/fernapi/server/velocity/FernVelocityAPI.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,16 @@ public FernVelocityAPI(ProxyServer server, Logger logger, PluginContainer plugin
4545
this.server = server;
4646
this.logger = logger;
4747

48-
49-
5048
messageHandler = new VelocityMessageHandler(this);
5149
this.pluginContainer = pluginContainer;
50+
}
51+
52+
@Subscribe
53+
@OverridingMethodsMustInvokeSuper
54+
public void onProxyInitialization(ProxyInitializeEvent event) {
55+
// Do some operation demanding access to the Velocity API here.
56+
// For instance, we could register an event:
57+
server.getEventManager().register(this, messageHandler);
5258

5359
Universal.getInstance().setup(new VelocityInterface(this),
5460
this,
@@ -64,14 +70,6 @@ public FernVelocityAPI(ProxyServer server, Logger logger, PluginContainer plugin
6470
Universal.getMessageHandler().registerMessageHandler(VanishProxyCheck.LISTENER_INSTANCE);
6571
}
6672

67-
@Subscribe
68-
@OverridingMethodsMustInvokeSuper
69-
public void onProxyInitialization(ProxyInitializeEvent event) {
70-
// Do some operation demanding access to the Velocity API here.
71-
// For instance, we could register an event:
72-
server.getEventManager().register(this, messageHandler);
73-
}
74-
7573
@Subscribe
7674
@OverridingMethodsMustInvokeSuper
7775
public void onProxyStop(ProxyShutdownEvent event) {

0 commit comments

Comments
 (0)