Don't allow jailing in unloaded worlds and don't allow joining while

jailed in unloaded worlds.
This commit is contained in:
graywolf336
2014-07-14 22:53:48 -05:00
parent 5c4122ee92
commit a5bf89b07e
8 changed files with 64 additions and 1 deletions

View File

@ -174,6 +174,11 @@ public class JailCommand implements Command {
//Get the jail instance from the name of jail in the params.
Jail j = jm.getJail(jailName);
if(!j.isEnabled()) {
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.WORLDUNLOADED, j.getName()));
return true;
}
Cell c = j.getCell(params.getCell());
Prisoner pris = new Prisoner(uuid, params.getPlayer(), muted, time, sender.getName(), reason);

View File

@ -32,7 +32,8 @@ public class JailListCommand implements Command {
if(args.length == 1) {
//No jail provided, so give them a list of the jails
for(Jail j : jm.getJails()) {
sender.sendMessage(ChatColor.BLUE + " " + j.getName() + " (" + j.getAllPrisoners().size() + ")");
if(j.isEnabled()) sender.sendMessage(ChatColor.BLUE + " " + j.getName() + " (" + j.getAllPrisoners().size() + ")");
else sender.sendMessage(ChatColor.RED + " " + j.getName() + " (" + j.getAllPrisoners().size() + ") - WORLD UNLOADED");
}
}else {
Jail j = jm.getJail(args[1]);