mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 20:29:20 +00:00
28 lines
921 B
Java
28 lines
921 B
Java
package com.earth2me.essentials.commands;
|
|
|
|
import com.earth2me.essentials.Backup;
|
|
import com.earth2me.essentials.CommandSource;
|
|
import org.bukkit.Server;
|
|
|
|
import static com.earth2me.essentials.I18n.tl;
|
|
|
|
|
|
public class Commandbackup extends EssentialsCommand {
|
|
public Commandbackup() {
|
|
super("backup");
|
|
}
|
|
|
|
@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"));
|
|
}
|
|
}
|