Catch exceptions when disabling plugins

This commit is contained in:
Ammar Askar 2013-08-19 15:20:33 +02:00 committed by md_5
parent d8c92cd311
commit c352e854ee

View File

@ -359,8 +359,15 @@ public class BungeeCord extends ProxyServer
// TODO: Fix this shit // TODO: Fix this shit
getLogger().info( "Disabling plugins" ); getLogger().info( "Disabling plugins" );
for ( Plugin plugin : pluginManager.getPlugins() ) for ( Plugin plugin : pluginManager.getPlugins() )
{
try
{ {
plugin.onDisable(); plugin.onDisable();
} catch (Throwable t)
{
getLogger().severe( "Exception disabling plugin " + plugin.getDescription().getName() );
t.printStackTrace();
}
getScheduler().cancel( plugin ); getScheduler().cancel( plugin );
} }