2014-02-13 18:26:42 +01:00
|
|
|
package com.graywolf336.jail.command.subcommands;
|
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
|
|
|
|
import com.graywolf336.jail.JailManager;
|
2014-02-15 04:37:39 +01:00
|
|
|
import com.graywolf336.jail.beans.ConfirmPlayer;
|
2014-02-13 18:26:42 +01:00
|
|
|
import com.graywolf336.jail.command.Command;
|
|
|
|
import com.graywolf336.jail.command.CommandInfo;
|
2014-02-15 04:37:39 +01:00
|
|
|
import com.graywolf336.jail.enums.Confirmation;
|
2014-02-13 18:26:42 +01:00
|
|
|
import com.graywolf336.jail.enums.LangString;
|
|
|
|
|
|
|
|
@CommandInfo(
|
|
|
|
maxArgs = 1,
|
|
|
|
minimumArgs = 1,
|
|
|
|
needsPlayer = false,
|
|
|
|
pattern = "delete|d",
|
|
|
|
permission = "jail.command.jaildelete",
|
|
|
|
usage = "/jail delete <jail>"
|
|
|
|
)
|
|
|
|
public class JailDeleteCommand implements Command {
|
|
|
|
public boolean execute(JailManager jm, CommandSender sender, String... args) throws Exception {
|
2014-02-15 04:37:39 +01:00
|
|
|
if(jm.isConfirming(sender.getName())) {
|
|
|
|
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.ALREADY));
|
2014-02-13 18:26:42 +01:00
|
|
|
}else {
|
2014-02-15 04:37:39 +01:00
|
|
|
jm.addConfirming(sender.getName(), new ConfirmPlayer(sender.getName(), args, Confirmation.DELETE));
|
|
|
|
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.START));
|
2014-02-13 18:26:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|