public void setLock(ItemStack lock) {
   if (lock != null && !isItemStackLock(lock))
     throw new InvalidParameterException("lock is not an ItemStack of ItemLock.");
   TileEntityReinforcedChest chest = getMainChest();
   chest.lock = lock;
   worldObj.markBlockForUpdate(chest.xCoord, chest.yCoord, chest.zCoord);
 }
  public void checkForAdjacentChests() {
    if (adjacentChestChecked) return;

    adjacentChestChecked = true;
    adjacentChestZNeg = null;
    adjacentChestXPos = null;
    adjacentChestXNeg = null;
    adjacentChestZPos = null;

    if (worldObj.getBlockId(xCoord, yCoord, zCoord - 1) == id)
      adjacentChestZNeg = getChestAt(worldObj, xCoord, yCoord, zCoord - 1);
    if (worldObj.getBlockId(xCoord, yCoord, zCoord + 1) == id)
      adjacentChestZPos = getChestAt(worldObj, xCoord, yCoord, zCoord + 1);
    if (worldObj.getBlockId(xCoord - 1, yCoord, zCoord) == id)
      adjacentChestXNeg = getChestAt(worldObj, xCoord - 1, yCoord, zCoord);
    if (worldObj.getBlockId(xCoord + 1, yCoord, zCoord) == id)
      adjacentChestXPos = getChestAt(worldObj, xCoord + 1, yCoord, zCoord);
    if (adjacentChestZNeg != null) adjacentChestZNeg.updateContainingBlockInfo();
    if (adjacentChestZPos != null) adjacentChestZPos.updateContainingBlockInfo();
    if (adjacentChestXNeg != null) adjacentChestXNeg.updateContainingBlockInfo();
    if (adjacentChestXPos != null) adjacentChestXPos.updateContainingBlockInfo();
  }