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

@ -21,6 +21,7 @@ import com.graywolf336.jail.Util;
*/
public class Jail {
private JailMain plugin;
private boolean enabled;
private HashMap<String, Cell> cells;
private HashMap<UUID, Prisoner> nocellPrisoners;//prisoners who aren't in a cell
private String name = "", world = "";
@ -29,6 +30,7 @@ public class Jail {
public Jail(JailMain plugin, String name) {
this.plugin = plugin;
this.enabled = true;
this.name = name;
cells = new HashMap<String, Cell>();
nocellPrisoners = new HashMap<UUID, Prisoner>();
@ -39,6 +41,16 @@ public class Jail {
return this.plugin;
}
/** Sets whether this jail can be used or not. */
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
/** Gets whether this jail is enabled or not. */
public boolean isEnabled() {
return this.enabled;
}
/** Sets the name of the jail. */
public void setName(String name) {
this.name = name;