Jail/src/main/java/com/graywolf336/jail/command/subcommands/JailDeleteCommand.java

32 lines
1.1 KiB
Java
Raw Normal View History

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;
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;
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));
}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));
}
return true;
}
}