Fix server generator when using MC Server 1.3.2.

MCServerChunkGenerator.copyChunkAtPosition copies the compressed chunk data instead of the uncompressed tag. This is because AnvilChunk removes parts of the tag when emulating the older chunk format.
This commit is contained in:
David Vierra 2012-10-08 19:08:27 -10:00
parent 7696ff9dfa
commit 87b97ab157

View File

@ -440,20 +440,17 @@ class MCServerChunkGenerator(object):
except ChunkNotPresent, e: except ChunkNotPresent, e:
raise ChunkNotPresent("While generating a world in {0} using server {1} ({2!r})".format(tempWorld, self.serverJarFile, e), sys.exc_traceback) raise ChunkNotPresent("While generating a world in {0} using server {1} ({2!r})".format(tempWorld, self.serverJarFile, e), sys.exc_traceback)
tempChunk.decompress() tempChunk.compress()
tempChunk.unpackChunkData() data = tempChunk.compressedTag
root_tag = tempChunk.root_tag
if not level.containsChunk(cx, cz): if not level.containsChunk(cx, cz):
level.createChunk(cx, cz) level.createChunk(cx, cz)
chunk = level.getChunk(cx, cz) chunk = level.getChunk(cx, cz)
chunk.decompress() chunk.compress()
chunk.unpackChunkData() chunk.compressedTag = data # xxx tag swap, could copy blocks and entities and chunk attrs instead?
chunk.root_tag = root_tag # xxx tag swap, could copy blocks and entities and chunk attrs instead?
chunk.dirty = True chunk.dirty = True
chunk.compress()
chunk.save() chunk.save()
chunk.unload() chunk.unload()
tempChunk.compress() tempChunk.compress()