Lots of progress was made towards jailing the player.

We now handle the jailing of the players and even store their inventory.
Unjailing hasn't been tested at all yet, so that's still to do.
This commit is contained in:
graywolf336
2013-12-27 18:19:47 -06:00
parent d9f88b8eef
commit e4f74e5e91
12 changed files with 235 additions and 37 deletions

View File

@ -2,6 +2,7 @@ package com.graywolf336.jail.beans;
import java.util.HashSet;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Chest;
@ -32,6 +33,11 @@ public class Cell {
return this.name;
}
/** Updates the signs of the cell, with the player name and time and such. TODO */
public void update() {
//TODO: Update the signs
}
/** Sets the prisoner in this cell. */
public void setPrisoner(Prisoner prisoner) {
this.p = prisoner;
@ -102,4 +108,20 @@ public class Cell {
return (Chest) this.chest.getLocation().getBlock().getState();
}
/**
* Checks if the chest location doesn't equal null and if it is a double chest.
*
* @return true if there is a chest, false if there isn't.
*/
public boolean hasChest() {
if(getChest() != null) {
if(getChest().getInventory().getSize() == 40) return true;
else {
Bukkit.getLogger().severe("The cell " + this.name + " has chest that isn't a double chest, please fix.");
return false;
}
}else
return false;
}
}