@Override
	protected void onDisconnect() {
		for (final Module m : enabledModules.values()) {
			if (m.onDisconnect()) {
				break;
			}
		}
		if (cleanDc) {
			dispose();
		} else {
			boolean connected = false;
			final int attempts = 0;
			try {
				while (!connected && (attempts < maxReconnects)) {
					Thread.sleep(1000 * timeBetweenReconnects);
					try {
						reconnect();
						settings.read();
						nickPass = settings.getModuleSettingChar(CORE_MODULE_NAME, "nickserv_pass");
						connected = true;
					} catch (final Exception e) {
						e.printStackTrace();
					}
				}
			} catch (final InterruptedException e) {
				// Should NEVER happen
				e.printStackTrace();
			}
			if (!connected) {
				log("Lost connection. Could not reconnect.");
				dispose();
			}
		}
	}