From b396707cb9a2372cf6c8e72d3fb6f79fa28625e8 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Sun, 27 Feb 2011 14:55:29 +0000 Subject: [PATCH] Catch errors loading plugins --- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 93b9a7d7ce..9e6b49b6dd 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 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() {