Only try to jail in a cell if that jail has cells, resolves #51
This commit is contained in:
@ -152,7 +152,14 @@ public class JailCommand implements Command {
|
||||
|
||||
//If they want just any open cell or automatic jailing in cells is turned on
|
||||
//and a cell wasn't already found, then find try to find a cell
|
||||
if((params.isAnyCell() || jm.getPlugin().getConfig().getBoolean(Settings.AUTOMATICCELL.getPath(), true)) && c == null) {
|
||||
if(params.isAnyCell() && c == null) {
|
||||
c = jm.getJail(jailName).getFirstEmptyCell();
|
||||
if(c == null) {
|
||||
//If there wasn't an empty cell, then tell them so.
|
||||
sender.sendMessage(Lang.NOEMPTYCELLS.get(jailName));
|
||||
return true;
|
||||
}
|
||||
}else if(jm.getPlugin().getConfig().getBoolean(Settings.AUTOMATICCELL.getPath(), true) && j.hasCells() && c == null) {
|
||||
c = jm.getJail(jailName).getFirstEmptyCell();
|
||||
if(c == null) {
|
||||
//If there wasn't an empty cell, then tell them so.
|
||||
|
Reference in New Issue
Block a user