@SuppressWarnings("deprecation")
private void printStackTraceSync(Throwable t, boolean expected)
  {
	BukkitScheduler bs = plugin.getServer().getScheduler();
	try
	{
	  String prefix = "[AutoUpdate] ";
	  StringWriter sw = new StringWriter();
	  PrintWriter pw = new PrintWriter(sw);
	  t.printStackTrace(pw);
	  String[] sts = sw.toString().replace("\r", "").split("\n");
	  String[] out;
	  if(expected)
		out = new String[sts.length+25];
	  else
		out = new String[sts.length+27];
	  out[0] = prefix;
	  out[1] = prefix+"Internal error!";
	  out[2] = prefix+"If this bug hasn't been reported please open a ticket at http://forums.bukkit.org/threads/autoupdate-update-your-plugins.84421/";
	  out[3] = prefix+"Include the following into your bug report:";
	  out[4] = prefix+"          ======= SNIP HERE =======";
	  int i = 5;
	  for(; i-5 < sts.length; i++)
		out[i] = prefix+sts[i-5];
	  out[++i] = prefix+"          ======= DUMP =======";
	  out[++i] = prefix+"version        : "+version;
	  out[++i] = prefix+"delay          : "+delay;
	  out[++i] = prefix+"bukkitdevSlug  : "+bukkitdevSlug;
	  out[++i] = prefix+"COLOR_INFO     : "+COLOR_INFO.name();
	  out[++i] = prefix+"COLO_OK        : "+COLOR_OK.name();
	  out[++i] = prefix+"COLOR_ERROR    : "+COLOR_ERROR.name();
	  out[++i] = prefix+"pid            : "+pid;
	  out[++i] = prefix+"av             : "+av;
	  out[++i] = prefix+"config         : "+config;
	  out[++i] = prefix+"lock           : "+lock.get();
	  out[++i] = prefix+"needUpdate     : "+needUpdate;
	  out[++i] = prefix+"updatePending  : "+updatePending;
	  out[++i] = prefix+"UpdateUrl      : "+updateURL;
	  out[++i] = prefix+"updateVersion  : "+updateVersion;
	  out[++i] = prefix+"pluginURL      : "+pluginURL;
	  out[++i] = prefix+"type           : "+type;
	  out[++i] = prefix+"          ======= SNIP HERE =======";
	  out[++i] = prefix;
	  if(!expected)
	  {
		out[++i] = prefix+"DISABLING UPDATER!";
		out[++i] = prefix;
	  }
	  bs.scheduleSyncDelayedTask(plugin, new SyncMessageDelayer(null, out));
	}
	catch(Throwable e) //This prevents endless loops.
	{
	  e.printStackTrace();
	}
	if(!expected)
	{
	  bs.cancelTask(pid);
	  bs.scheduleAsyncDelayedTask(plugin, new Runnable()
	  {
		public void run()
		{
		  while(!lock.compareAndSet(false, true))
		  {
			try
			{
			  Thread.sleep(1L);
			}
			  catch(InterruptedException e)
			{
			}
		  }
		  pid = -1;
		  config = null;
		  needUpdate = updatePending = enabled = false;
		  updateURL = updateVersion = pluginURL = type = null;
		  lock.set(false);
		}
	  });
	}
  }