Skip to content

Commit 8a97647

Browse files
committed
Injecting plugin container because grabbing it too early
1 parent 4c8f754 commit 8a97647

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,14 @@ public class FernVelocityAPI implements FernAPIPlugin {
4141
protected final PluginContainer pluginContainer;
4242

4343
@Inject
44-
public FernVelocityAPI(ProxyServer server, Logger logger) {
44+
public FernVelocityAPI(ProxyServer server, Logger logger, PluginContainer pluginContainer) {
4545
this.server = server;
4646
this.logger = logger;
4747

4848

4949

5050
messageHandler = new VelocityMessageHandler(this);
51-
52-
53-
pluginContainer = server.getPluginManager().fromInstance(this).orElseThrow(() -> new IllegalStateException("The server does not have plugin container instance loaded yet?"));
54-
51+
this.pluginContainer = pluginContainer;
5552

5653
Universal.getInstance().setup(new VelocityInterface(this),
5754
this,

0 commit comments

Comments
 (0)