13
0
geforkt von Mirrors/Velocity

Explicity bind the main plugin class in the singleton scope

Dieser Commit ist enthalten in:
kashike 2019-06-14 01:06:08 -07:00
Ursprung 57c8c07c9d
Commit 335c34a679

Datei anzeigen

@ -2,6 +2,7 @@ package com.velocitypowered.proxy.plugin.loader.java;
import com.google.inject.Binder; import com.google.inject.Binder;
import com.google.inject.Module; import com.google.inject.Module;
import com.google.inject.Scopes;
import com.velocitypowered.api.command.CommandManager; import com.velocitypowered.api.command.CommandManager;
import com.velocitypowered.api.event.EventManager; import com.velocitypowered.api.event.EventManager;
import com.velocitypowered.api.plugin.PluginDescription; import com.velocitypowered.api.plugin.PluginDescription;
@ -27,6 +28,8 @@ class VelocityPluginModule implements Module {
@Override @Override
public void configure(Binder binder) { public void configure(Binder binder) {
binder.bind(description.getMainClass()).in(Scopes.SINGLETON);
binder.bind(Logger.class).toInstance(LoggerFactory.getLogger(description.getId())); binder.bind(Logger.class).toInstance(LoggerFactory.getLogger(description.getId()));
binder.bind(ProxyServer.class).toInstance(server); binder.bind(ProxyServer.class).toInstance(server);
binder.bind(Path.class).annotatedWith(DataDirectory.class) binder.bind(Path.class).annotatedWith(DataDirectory.class)