From 346b0aab9928c355b86e1861036d4f0d7a04be1d Mon Sep 17 00:00:00 2001 From: David Vierra Date: Thu, 30 Jun 2011 14:11:49 -1000 Subject: [PATCH] add chunkIsCompressed/Dirty, clean up chunkIsLoaded --- mclevel.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/mclevel.py b/mclevel.py index 13fe595..5de27ab 100644 --- a/mclevel.py +++ b/mclevel.py @@ -3208,12 +3208,22 @@ class MCInfdevOldLevel(MCLevel): def chunkIsLoaded(self, cx, cz): if (cx,cz) in self._loadedChunks: - if( self._loadedChunks[(cx,cz)].compressedTag is not None or - self._loadedChunks[(cx,cz)].root_tag is not None): - return True + return self._loadedChunks[(cx,cz)].isLoaded() 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): """ read the chunk from disk, load it, and return it. decompression and unpacking is done lazily."""