package com.gamingmesh.jobs.commands.list;

import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.commands.Cmd;
import com.gamingmesh.jobs.dao.JobsManager.DataBaseType;

public class convert implements Cmd {

    @Override
    public boolean perform(Jobs plugin, CommandSender sender, String[] args) {
	if (sender instanceof Player) {
	    sender.sendMessage(Jobs.getLanguage().getMessage("general.error.fromconsole"));
	    return true;
	}

	if (args.length > 0) {
	    Jobs.getCommandManager().sendUsage(sender, "convert");
	    return true;
	}

	Jobs.convertDatabase();

	String from = "MySQL";
	String to = "SQLite";

	if (Jobs.getDBManager().getDbType() != DataBaseType.SqLite) {
	    from = "SQLite";
	    to = "MySQL";
	}

	Jobs.consoleMsg("&eData base was converted from &2" + from + " &eto &2" + to + "&e!");

	return true;
    }
}

@@ -35,24 +35,51 @@
 ds.list;%0D%0A%0D%0A
+import org.bukkit.Bukkit;%0D%0A
 import org.b
@@ -673,21 +673,74 @@
 %0A%09%7D%0D%0A%0D%0A%09
+Bukkit.getScheduler().runTaskAsynchronously(plugin, 
 Jobs
-.
+::
 convertD
@@ -746,17 +746,16 @@
 Database
-(
 );%0D%0A%0D%0A%09S

Convert Database Async