TF-EssentialsX/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java
snowleo 6427a93d14 Correctly charge for the use of commands.
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.
2011-08-27 23:14:49 +02:00

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"));
}
}