Saber-Factions/src/main/java/com/massivecraft/factions/cmd/CmdConvert.java

39 lines
1.0 KiB
Java
Raw Normal View History

package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Conf.Backend;
import com.massivecraft.factions.zcore.persist.json.FactionsJSON;
2014-11-06 01:36:47 +01:00
import org.bukkit.command.ConsoleCommandSender;
public class CmdConvert extends FCommand {
public CmdConvert() {
this.aliases.add("convert");
this.requiredArgs.add("[MYSQL|JSON]");
}
@Override
public void perform() {
if (!(this.sender instanceof ConsoleCommandSender)) {
this.sender.sendMessage("Console only command");
}
Backend nb = Backend.valueOf(this.argAsString(0).toUpperCase());
if (nb == Conf.backEnd) {
this.sender.sendMessage("Already running that backend");
return;
}
switch (nb) {
case JSON:
FactionsJSON.convertTo();
break;
default:
this.sender.sendMessage("Invalid backend");
return;
2014-11-06 01:36:47 +01:00
}
Conf.backEnd = nb;
}
}