From 335c34a6790d9cd30934f685ddce6ae28fdf27a8 Mon Sep 17 00:00:00 2001 From: kashike Date: Fri, 14 Jun 2019 01:06:08 -0700 Subject: [PATCH] Explicity bind the main plugin class in the singleton scope --- .../proxy/plugin/loader/java/VelocityPluginModule.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/java/VelocityPluginModule.java b/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/java/VelocityPluginModule.java index 0f5a61cf1..897e37130 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/java/VelocityPluginModule.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/java/VelocityPluginModule.java @@ -2,6 +2,7 @@ package com.velocitypowered.proxy.plugin.loader.java; import com.google.inject.Binder; import com.google.inject.Module; +import com.google.inject.Scopes; import com.velocitypowered.api.command.CommandManager; import com.velocitypowered.api.event.EventManager; import com.velocitypowered.api.plugin.PluginDescription; @@ -27,6 +28,8 @@ class VelocityPluginModule implements Module { @Override public void configure(Binder binder) { + binder.bind(description.getMainClass()).in(Scopes.SINGLETON); + binder.bind(Logger.class).toInstance(LoggerFactory.getLogger(description.getId())); binder.bind(ProxyServer.class).toInstance(server); binder.bind(Path.class).annotatedWith(DataDirectory.class)