Make sure plugin onLoad is really called onLoad. This fixes regression #822 from when we implemented plugin depends.

This commit is contained in:
md_5 2014-01-22 12:07:16 +11:00
parent 05f4e69afd
commit aa91354666
2 changed files with 7 additions and 2 deletions

View File

@ -179,7 +179,7 @@ public class PluginManager
return plugins.get( name ); return plugins.get( name );
} }
public void loadAndEnablePlugins() public void loadPlugins()
{ {
Map<PluginDescription, Boolean> pluginStatuses = new HashMap<>(); Map<PluginDescription, Boolean> pluginStatuses = new HashMap<>();
for ( Map.Entry<String, PluginDescription> entry : toLoad.entrySet() ) for ( Map.Entry<String, PluginDescription> entry : toLoad.entrySet() )
@ -192,7 +192,10 @@ public class PluginManager
} }
toLoad.clear(); toLoad.clear();
toLoad = null; toLoad = null;
}
public void enablePlugins()
{
for ( Plugin plugin : plugins.values() ) for ( Plugin plugin : plugins.values() )
{ {
try try

View File

@ -194,11 +194,13 @@ public class BungeeCord extends ProxyServer
pluginsFolder.mkdir(); pluginsFolder.mkdir();
pluginManager.detectPlugins( pluginsFolder ); pluginManager.detectPlugins( pluginsFolder );
pluginManager.loadPlugins();
config.load(); config.load();
isRunning = true; isRunning = true;
pluginManager.loadAndEnablePlugins(); pluginManager.enablePlugins();
connectionThrottle = new ConnectionThrottle( config.getThrottle() ); connectionThrottle = new ConnectionThrottle( config.getThrottle() );
startListeners(); startListeners();