Broken plugins no longer crash the server

This commit is contained in:
Dinnerbone
2010-12-30 18:54:04 +00:00
parent df119a36e0
commit 6ddb16a8dd
3 changed files with 15 additions and 1 deletions

View File

@@ -176,7 +176,11 @@ public final class SimplePluginManager implements PluginManager {
PluginLoader loader = plugin.getPluginLoader();
if (plugin.isEnabled()) {
loader.callEvent(registration, event);
try {
loader.callEvent(registration, event);
} catch (Throwable ex) {
Logger.getLogger(SimplePluginManager.class.getName()).log(Level.SEVERE, "Could not pass event " + event.getType() + " to " + plugin.getDescription().getName(), ex);
}
}
}
}