mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-10-03 15:24:21 +00:00
6427a93d14
We now first test, if the user could pay it, do the stuff and then charge him. If the command throws an exception, the user will not be charged.
28 lines
579 B
Java
28 lines
579 B
Java
package com.earth2me.essentials.commands;
|
|
|
|
import com.earth2me.essentials.Backup;
|
|
import com.earth2me.essentials.Util;
|
|
import org.bukkit.Server;
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
|
|
public class Commandbackup extends EssentialsCommand
|
|
{
|
|
public Commandbackup()
|
|
{
|
|
super("backup");
|
|
}
|
|
|
|
@Override
|
|
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
|
{
|
|
Backup backup = ess.getBackup();
|
|
if (backup == null)
|
|
{
|
|
throw new Exception();
|
|
}
|
|
backup.run();
|
|
sender.sendMessage(Util.i18n("backupStarted"));
|
|
}
|
|
}
|