From a10ef86ae940974d9debb77a1c462077368ce276 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sun, 6 Mar 2011 15:30:12 -1000 Subject: [PATCH] this code was completely unused! --- mclevel.py | 55 +++++------------------------------------------------- 1 file changed, 5 insertions(+), 50 deletions(-) diff --git a/mclevel.py b/mclevel.py index b5a477e..c310e9c 100644 --- a/mclevel.py +++ b/mclevel.py @@ -470,57 +470,12 @@ class MCLevel(object): def close(self): pass - - def compress(self): - #if self.root_tag is not None, then our compressed data must be stale and we need to recompress. - - if self.root_tag is None: - return; - else: - self.packChunkData(); - - buf = StringIO.StringIO() - with closing(gzip.GzipFile(fileobj=buf, mode='wb', compresslevel=2)) as gzipper: - self.root_tag.save(buf=gzipper) - - self.compressedTag = buf.getvalue() - - self.root_tag = None - - def decompress(self): - """called when accessing attributes decorated with @decompress_first""" - if self.root_tag != None: return - if self.compressedTag is None: - if self.root_tag is None: - self.load(); - else: - return; - - with closing(gzip.GzipFile(fileobj=StringIO.StringIO(self.compressedTag))) as gzipper: - try: - data = gzipper.read(); - if data == None: return; - except Exception, e: - #error( u"Error reading compressed data, assuming uncompressed: {0}".format(e) ) - data = self.compressedTag - - - try: - self.root_tag = nbt.load(buf=fromstring(data, dtype='uint8')); - except Exception, e: - error( u"Malformed NBT data in file: {0} ({1})".format(self.filename, e) ) - if self.world: self.world.malformedChunk(*self.chunkPosition); - raise ChunkMalformed, self.filename - - try: - self.shapeChunkData() - except KeyError, e: - error( u"Incorrect chunk format in file: {0} ({1})".format(self.filename, e) ) - if self.world: self.world.malformedChunk(*self.chunkPosition); - raise ChunkMalformed, self.filename - - self.dataIsPacked = True; + def compress(self): + pass + def decompress(self): + pass + def compressChunk(self, x, z): pass def entitiesAt(self, x, y, z):