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:
raise ChunkNotPresent("While generating a world in {0} using server {1} ({2!r})".format(tempWorld, self.serverJarFile, e), sys.exc_traceback)
tempChunk.decompress()
tempChunk.unpackChunkData()
root_tag = tempChunk.root_tag
tempChunk.compress()
data = tempChunk.compressedTag
if not level.containsChunk(cx, cz):
level.createChunk(cx, cz)
chunk = level.getChunk(cx, cz)
chunk.decompress()
chunk.unpackChunkData()
chunk.root_tag = root_tag # xxx tag swap, could copy blocks and entities and chunk attrs instead?
chunk.compress()
chunk.compressedTag = data # xxx tag swap, could copy blocks and entities and chunk attrs instead?
chunk.dirty = True
chunk.compress()
chunk.save()
chunk.unload()
tempChunk.compress()