From 6602c2214786e1d9414c2b366523dca26573217f Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 14 Jan 2014 13:18:14 +1100 Subject: [PATCH] Ensure modules are enabled even when we can't detect version --- proxy/src/main/java/net/md_5/bungee/BungeeCord.java | 4 +++- .../src/main/java/net/md_5/bungee/module/ModuleManager.java | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java index 4825fb51..cbcd64c5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -189,7 +189,9 @@ public class BungeeCord extends ProxyServer { ResourceLeakDetector.setEnabled( false ); // Eats performance - moduleManager.load( this ); + File moduleDirectory = new File( "modules" ); + moduleManager.load( this, moduleDirectory ); + pluginManager.detectPlugins( moduleDirectory ); pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); diff --git a/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java b/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java index 6fb3eef4..607e6ff4 100644 --- a/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java +++ b/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java @@ -30,7 +30,7 @@ public class ModuleManager knownSources.put( "jenkins", new JenkinsModuleSource() ); } - public void load(ProxyServer proxy) throws Exception + public void load(ProxyServer proxy, File moduleDirectory) throws Exception { ModuleVersion bungeeVersion = ModuleVersion.parse( proxy.getVersion() ); if ( bungeeVersion == null ) @@ -39,7 +39,6 @@ public class ModuleManager return; } - File moduleDirectory = new File( "modules" ); moduleDirectory.mkdir(); List modules = new ArrayList<>(); @@ -121,8 +120,6 @@ public class ModuleManager module.getProvider().retrieve( module, bungeeVersion ); } } - - proxy.getPluginManager().detectPlugins( moduleDirectory ); } private ModuleVersion getVersion(File file)