allow world to override chunk save, too
This commit is contained in:
parent
3a6cf84ac2
commit
76d0d19de7
@ -1523,9 +1523,7 @@ class InfdevChunk(MCLevel):
|
|||||||
debug( u"No existing chunk file to rename" )
|
debug( u"No existing chunk file to rename" )
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
chunkfh = file(self.filename, 'wb')
|
self.world._saveChunk(self, self.compressedTag)
|
||||||
chunkfh.write(self.compressedTag)
|
|
||||||
chunkfh.close()
|
|
||||||
|
|
||||||
debug( u"Saved chunk {0}".format( self ) )
|
debug( u"Saved chunk {0}".format( self ) )
|
||||||
except IOError,e:
|
except IOError,e:
|
||||||
@ -2041,6 +2039,11 @@ class MCInfdevOldLevel(MCLevel):
|
|||||||
|
|
||||||
def _loadChunk(self, chunk):
|
def _loadChunk(self, chunk):
|
||||||
return file(chunk.filename, 'rb')
|
return file(chunk.filename, 'rb')
|
||||||
|
|
||||||
|
def _saveChunk(self, chunk, data):
|
||||||
|
chunkfh = file(chunk.filename, 'wb')
|
||||||
|
chunkfh.write(data)
|
||||||
|
chunkfh.close()
|
||||||
|
|
||||||
def discardAllChunks(self):
|
def discardAllChunks(self):
|
||||||
""" clear lots of memory, fast. """
|
""" clear lots of memory, fast. """
|
||||||
|
Reference in New Issue
Block a user