allow world to override chunk save, too

This commit is contained in:
David Vierra 2010-11-15 05:50:12 -10:00
parent 3a6cf84ac2
commit 76d0d19de7

View File

@ -1523,9 +1523,7 @@ class InfdevChunk(MCLevel):
debug( u"No existing chunk file to rename" )
pass
try:
chunkfh = file(self.filename, 'wb')
chunkfh.write(self.compressedTag)
chunkfh.close()
self.world._saveChunk(self, self.compressedTag)
debug( u"Saved chunk {0}".format( self ) )
except IOError,e:
@ -2042,6 +2040,11 @@ class MCInfdevOldLevel(MCLevel):
def _loadChunk(self, chunk):
return file(chunk.filename, 'rb')
def _saveChunk(self, chunk, data):
chunkfh = file(chunk.filename, 'wb')
chunkfh.write(data)
chunkfh.close()
def discardAllChunks(self):
""" clear lots of memory, fast. """