2014-02-01 01:24:44 -06:00
|
|
|
package com.graywolf336.jail.command.subcommands;
|
2013-12-05 18:22:15 -06:00
|
|
|
|
2014-02-12 15:35:29 -06:00
|
|
|
import org.bukkit.ChatColor;
|
2013-12-05 18:22:15 -06:00
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
|
|
|
|
import com.graywolf336.jail.JailManager;
|
2014-02-12 15:35:29 -06:00
|
|
|
import com.graywolf336.jail.beans.Prisoner;
|
2013-12-05 18:22:15 -06:00
|
|
|
import com.graywolf336.jail.command.Command;
|
|
|
|
import com.graywolf336.jail.command.CommandInfo;
|
2014-01-23 18:51:22 -06:00
|
|
|
import com.graywolf336.jail.enums.LangString;
|
2013-12-05 18:22:15 -06:00
|
|
|
|
|
|
|
@CommandInfo(
|
|
|
|
maxArgs = 1,
|
2014-02-12 15:35:29 -06:00
|
|
|
minimumArgs = 1,
|
2014-01-21 18:09:47 -06:00
|
|
|
needsPlayer = false,
|
2014-02-01 01:24:44 -06:00
|
|
|
pattern = "check",
|
2013-12-05 18:22:15 -06:00
|
|
|
permission = "jail.command.jailcheck",
|
2014-02-12 15:35:29 -06:00
|
|
|
usage = "/jail check <playername>"
|
2013-12-05 18:22:15 -06:00
|
|
|
)
|
|
|
|
public class JailCheckCommand implements Command{
|
|
|
|
|
2014-02-12 15:35:29 -06:00
|
|
|
// Checks the status of the specified prisoner
|
2013-12-05 18:22:15 -06:00
|
|
|
public boolean execute(JailManager jm, CommandSender sender, String... args) {
|
2014-02-12 15:35:29 -06:00
|
|
|
//Otherwise let's check the first argument
|
|
|
|
if(jm.isPlayerJailed(args[1])) {
|
|
|
|
Prisoner p = jm.getPrisoner(args[1]);
|
|
|
|
|
|
|
|
//graywolf663: Being gray's evil twin; CONSOLE (10)
|
|
|
|
//prisoner: reason; jailer (time in minutes)
|
|
|
|
sender.sendMessage(ChatColor.BLUE + " " + p.getName() + ": " + p.getReason() + "; " + p.getJailer() + " (" + p.getRemainingTimeInMinutes() + " mins)");
|
2014-01-23 18:51:22 -06:00
|
|
|
}else {
|
2014-02-12 15:35:29 -06:00
|
|
|
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.NOTJAILED, args[1]));
|
2014-01-23 18:51:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
2013-12-05 18:22:15 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|