2011-03-19 23:39:51 +01:00
|
|
|
package com.earth2me.essentials.commands;
|
|
|
|
|
|
|
|
import com.earth2me.essentials.Backup;
|
2013-10-16 21:59:39 +02:00
|
|
|
import com.earth2me.essentials.CommandSource;
|
2011-03-19 23:39:51 +01:00
|
|
|
import org.bukkit.Server;
|
|
|
|
|
2015-04-15 06:06:16 +02:00
|
|
|
import static com.earth2me.essentials.I18n.tl;
|
|
|
|
|
|
|
|
public class Commandbackup extends EssentialsCommand {
|
|
|
|
public Commandbackup() {
|
|
|
|
super("backup");
|
|
|
|
}
|
2011-03-19 23:39:51 +01:00
|
|
|
|
2015-04-15 06:06:16 +02:00
|
|
|
@Override
|
|
|
|
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {
|
|
|
|
final Backup backup = ess.getBackup();
|
|
|
|
if (backup == null) {
|
|
|
|
throw new Exception(tl("backupDisabled"));
|
|
|
|
}
|
|
|
|
final String command = ess.getSettings().getBackupCommand();
|
|
|
|
if (command == null || "".equals(command) || "save-all".equalsIgnoreCase(command)) {
|
|
|
|
throw new Exception(tl("backupDisabled"));
|
|
|
|
}
|
|
|
|
backup.run();
|
|
|
|
sender.sendMessage(tl("backupStarted"));
|
|
|
|
}
|
2011-03-19 23:39:51 +01:00
|
|
|
}
|