add chunkIsCompressed/Dirty, clean up chunkIsLoaded

This commit is contained in:
David Vierra 2011-06-30 14:11:49 -10:00
parent 91490dfd10
commit 346b0aab99

View File

@ -3208,12 +3208,22 @@ class MCInfdevOldLevel(MCLevel):
def chunkIsLoaded(self, cx, cz): def chunkIsLoaded(self, cx, cz):
if (cx,cz) in self._loadedChunks: if (cx,cz) in self._loadedChunks:
if( self._loadedChunks[(cx,cz)].compressedTag is not None or return self._loadedChunks[(cx,cz)].isLoaded()
self._loadedChunks[(cx,cz)].root_tag is not None):
return True
return False return False
def chunkIsCompressed(self, cx, cz):
if (cx,cz) in self._loadedChunks:
return self._loadedChunks[(cx,cz)].isCompressed()
return False
def chunkIsDirty(self, cx, cz):
if (cx,cz) in self._loadedChunks:
return self._loadedChunks[(cx,cz)].dirty
return False
def getChunk(self, cx, cz): def getChunk(self, cx, cz):
""" read the chunk from disk, load it, and return it. """ read the chunk from disk, load it, and return it.
decompression and unpacking is done lazily.""" decompression and unpacking is done lazily."""