Reimplment automatically jailing in cells, fixes #42.

New config option if you want to disable this option.
This commit is contained in:
graywolf336
2015-02-09 22:08:59 -06:00
parent 205e7a4e22
commit d819bd7d37
4 changed files with 6 additions and 2 deletions

View File

@ -146,8 +146,9 @@ public class JailCommand implements Command {
}
}
//If they want just any open cell, then let's find the first empty one
if(params.isAnyCell()) {
//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) {
c = jm.getJail(jailName).getFirstEmptyCell();
if(c == null) {
//If there wasn't an empty cell, then tell them so.

View File

@ -1,6 +1,7 @@
package com.graywolf336.jail.enums;
public enum Settings {
AUTOMATICCELL("jailing.jail.automaticCell"),
AUTOMATICMUTE("jailing.jail.automaticMute"),
BROADCASTJAILING("jailing.jail.broadcastJailing"),
BLOCKBREAKPENALTY("jailing.during.blockBreakPenalty"),