public class ConvertExperienceCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
FormulaType previousType = mcMMO.getFormulaManager().getPreviousFormulaType();
FormulaType newType = FormulaType.getFormulaType(args[1].toUpperCase());
if (newType == FormulaType.UNKNOWN) {
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Invalid"));
return true;
}
if (previousType == newType) {
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Same", newType.toString()));
return true;
}
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Start", previousType.toString(), newType.toString()));
UserManager.saveAll();
UserManager.clearAll();
new FormulaConversionTask(sender, newType).runTaskLater(mcMMO.p, 1);