From aa91354666761f6862fa1c0ce4c1d6fa74acd224 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 22 Jan 2014 12:07:16 +1100 Subject: [PATCH] Make sure plugin onLoad is really called onLoad. This fixes regression #822 from when we implemented plugin depends. --- .../main/java/net/md_5/bungee/api/plugin/PluginManager.java | 5 ++++- proxy/src/main/java/net/md_5/bungee/BungeeCord.java | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java index 7bb3b5c2..bbb5ea7f 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -179,7 +179,7 @@ public class PluginManager return plugins.get( name ); } - public void loadAndEnablePlugins() + public void loadPlugins() { Map pluginStatuses = new HashMap<>(); for ( Map.Entry entry : toLoad.entrySet() ) @@ -192,7 +192,10 @@ public class PluginManager } toLoad.clear(); toLoad = null; + } + public void enablePlugins() + { for ( Plugin plugin : plugins.values() ) { try 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 7f2c4e1c..c13a3137 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -194,11 +194,13 @@ public class BungeeCord extends ProxyServer pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); + + pluginManager.loadPlugins(); config.load(); isRunning = true; - pluginManager.loadAndEnablePlugins(); + pluginManager.enablePlugins(); connectionThrottle = new ConnectionThrottle( config.getThrottle() ); startListeners();