Ensure modules are enabled even when we can't detect version

This commit is contained in:
md_5 2014-01-14 13:18:14 +11:00
parent f1b329bf21
commit 6602c22147
2 changed files with 4 additions and 5 deletions

View File

@ -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 );

View File

@ -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<ModuleSpec> modules = new ArrayList<>();
@ -121,8 +120,6 @@ public class ModuleManager
module.getProvider().retrieve( module, bungeeVersion );
}
}
proxy.getPluginManager().detectPlugins( moduleDirectory );
}
private ModuleVersion getVersion(File file)