docs: def get_blockdata(self, x, z):
          """
          Return the decompressed binary data representing a chunk.
          
          May raise a RegionFileFormatError().
          If decompression of the data succeeds, all available data is returned, 
          even if it is shorter than what is specified in the header (e.g. in case
          of a truncated while and non-compressed data).
          """
          # read metadata block
          m = self.metadata[x, z]
          if m.status == STATUS_CHUNK_NOT_CREATED:
              raise InconceivedChunk("Chunk %d,%d is not present in region" % (x,z))
          elif m.status == STATUS_CHUNK_IN_HEADER:
              raise RegionHeaderError('Chunk %d,%d is in the region header' % (x,z))
          elif m.status == STATUS_CHUNK_OUT_OF_FILE and (m.length <= 1 or m.compression == None):
              # Chunk header is outside of the file.
              raise RegionHeaderError('Chunk %d,%d is partially/completely outside the file' % (x,z))
          elif m.status == STATUS_CHUNK_ZERO_LENGTH:
              if m.blocklength == 0:
                  raise RegionHeaderError('Chunk %d,%d has zero length' % (x,z))
              else:
                  raise ChunkHeaderError('Chunk %d,%d has zero length' % (x,z))
          elif m.blockstart * SECTOR_LENGTH + 5 >= self.size:
              raise RegionHeaderError('Chunk %d,%d is partially/completely outside the file' % (x,z))
  
          # status is STATUS_CHUNK_OK, STATUS_CHUNK_MISMATCHED_LENGTHS, STATUS_CHUNK_OVERLAPPING
          # or STATUS_CHUNK_OUT_OF_FILE.
          # The chunk is always read, but in case of an error, the exception may be different 
          # based on the status.
  
          err = None
          try:
              # offset comes in sectors of 4096 bytes + length bytes + compression byte
              self.file.seek(m.blockstart * SECTOR_LENGTH + 5)
              # Do not read past the length of the file.
              # The length in the file includes the compression byte, hence the -1.
              length = min(m.length - 1, self.size - (m.blockstart * SECTOR_LENGTH + 5))
              chunk = self.file.read(length)
              
              if (m.compression == COMPRESSION_GZIP):
                  # Python 3.1 and earlier do not yet support gzip.decompress(chunk)
                  f = gzip.GzipFile(fileobj=BytesIO(chunk))
                  chunk = bytes(f.read())
                  f.close()
              elif (m.compression == COMPRESSION_ZLIB):
                  chunk = zlib.decompress(chunk)
              elif m.compression != COMPRESSION_NONE:
                  raise ChunkDataError('Unknown chunk compression/format (%s)' % m.compression)
              
              return chunk
          except RegionFileFormatError:
              raise
          except Exception as e:
              # Deliberately catch the Exception and re-raise.
              # The details in gzip/zlib/nbt are irrelevant, just that the data is garbled.
              err = '%s' % e # avoid str(e) due to Unicode issues in Python 2.
          if err:
              # don't raise during exception handling to avoid the warning 
              # "During handling of the above exception, another exception occurred".
              # Python 3.3 solution (see PEP 409 & 415): "raise ChunkDataError(str(e)) from None"
              if m.status == STATUS_CHUNK_MISMATCHED_LENGTHS:
                  raise ChunkHeaderError('The length in region header and the length in the header of chunk %d,%d are incompatible' % (x,z))
              elif m.status == STATUS_CHUNK_OVERLAPPING:
                  raise ChunkHeaderError('Chunk %d,%d is overlapping with another chunk' % (x,z))
              else:
                  raise ChunkDataError(err)