Add jail list command, outputs the amount of prisoners in there.
This commit is contained in:
@ -0,0 +1,36 @@
|
||||
package com.graywolf336.jail.command.commands;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.graywolf336.jail.JailManager;
|
||||
import com.graywolf336.jail.beans.Jail;
|
||||
import com.graywolf336.jail.command.Command;
|
||||
import com.graywolf336.jail.command.CommandInfo;
|
||||
|
||||
@CommandInfo(
|
||||
maxArgs = 0,
|
||||
minimumArgs = 0,
|
||||
needsPlayer = false,
|
||||
pattern = "jaillist|jc",
|
||||
permission = "jail.command.jaillist",
|
||||
usage = "/jaillist"
|
||||
)
|
||||
public class JailListCommand implements Command {
|
||||
|
||||
@Override
|
||||
public boolean execute(JailManager jm, CommandSender sender, String... args) {
|
||||
sender.sendMessage(ChatColor.AQUA + "----------Jails----------");
|
||||
|
||||
if(!jm.getJails().isEmpty()) {
|
||||
for(Jail j : jm.getJails()) {
|
||||
sender.sendMessage(ChatColor.BLUE + " " + j.getName() + " (" + j.getAllPrisoners().size() + ")");
|
||||
}
|
||||
}else {
|
||||
sender.sendMessage(ChatColor.RED + " There are no jails.");
|
||||
}
|
||||
|
||||
sender.sendMessage(ChatColor.AQUA + "-------------------------");
|
||||
return true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user