Jail check is now for one player only, use jail list <jail> for all.
This commit is contained in:
parent
94111955a4
commit
b1ca15d10c
@ -1,35 +1,36 @@
|
|||||||
package com.graywolf336.jail.command.subcommands;
|
package com.graywolf336.jail.command.subcommands;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import com.graywolf336.jail.JailManager;
|
import com.graywolf336.jail.JailManager;
|
||||||
|
import com.graywolf336.jail.beans.Prisoner;
|
||||||
import com.graywolf336.jail.command.Command;
|
import com.graywolf336.jail.command.Command;
|
||||||
import com.graywolf336.jail.command.CommandInfo;
|
import com.graywolf336.jail.command.CommandInfo;
|
||||||
import com.graywolf336.jail.enums.LangString;
|
import com.graywolf336.jail.enums.LangString;
|
||||||
|
|
||||||
@CommandInfo(
|
@CommandInfo(
|
||||||
maxArgs = 1,
|
maxArgs = 1,
|
||||||
minimumArgs = 0,
|
minimumArgs = 1,
|
||||||
needsPlayer = false,
|
needsPlayer = false,
|
||||||
pattern = "check",
|
pattern = "check",
|
||||||
permission = "jail.command.jailcheck",
|
permission = "jail.command.jailcheck",
|
||||||
usage = "/jail check (Player name)"
|
usage = "/jail check <playername>"
|
||||||
)
|
)
|
||||||
public class JailCheckCommand implements Command{
|
public class JailCheckCommand implements Command{
|
||||||
|
|
||||||
// Checks the status of the specified prisoner, if no args, will display all players currently jailed
|
// Checks the status of the specified prisoner
|
||||||
public boolean execute(JailManager jm, CommandSender sender, String... args) {
|
public boolean execute(JailManager jm, CommandSender sender, String... args) {
|
||||||
//No args means show everyone
|
//Otherwise let's check the first argument
|
||||||
if(args.length == 1) {
|
|
||||||
//TODO
|
|
||||||
}else {
|
|
||||||
//Otherwise let's check the first arg
|
|
||||||
if(jm.isPlayerJailed(args[1])) {
|
if(jm.isPlayerJailed(args[1])) {
|
||||||
//TODO
|
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)");
|
||||||
}else {
|
}else {
|
||||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.NOTJAILED, args[1]));
|
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.NOTJAILED, args[1]));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user