diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-27 14:55:29 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-27 14:55:29 +0000 |
commit | b396707cb9a2372cf6c8e72d3fb6f79fa28625e8 (patch) | |
tree | 65cd11869df64aeb080eeb010f5ae899e007519d | |
parent | cb2ff3c8bbc064f3c6a5a71242c20b845733d4e7 (diff) | |
download | craftbukkit-b396707cb9a2372cf6c8e72d3fb6f79fa28625e8.tar craftbukkit-b396707cb9a2372cf6c8e72d3fb6f79fa28625e8.tar.gz craftbukkit-b396707cb9a2372cf6c8e72d3fb6f79fa28625e8.tar.lz craftbukkit-b396707cb9a2372cf6c8e72d3fb6f79fa28625e8.tar.xz craftbukkit-b396707cb9a2372cf6c8e72d3fb6f79fa28625e8.zip |
Catch errors loading plugins
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftServer.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 93b9a7d7..9e6b49b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -74,10 +74,16 @@ public final class CraftServer implements Server { private void loadPlugin(Plugin plugin) { List<Command> pluginCommands = PluginCommandYamlParser.parse(plugin); + if (!pluginCommands.isEmpty()) { commandMap.registerAll(plugin.getDescription().getName(), pluginCommands); } - pluginManager.enablePlugin(plugin); + + try { + pluginManager.enablePlugin(plugin); + } catch (Throwable ex) { + Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " loading " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); + } } public String getName() { |