change getChunks to return an iterator

This commit is contained in:
David Vierra 2011-08-04 05:17:07 -10:00
parent aca3bf88e7
commit 72dc4374dd

View File

@ -1516,11 +1516,11 @@ class MCInfdevOldLevel(MCLevel):
def getChunks(self, chunks=None):
""" pass a list of chunk coordinate tuples to get a list of InfdevChunks.
pass nothing for a list of every chunk in the level.
""" pass a list of chunk coordinate tuples to get an iterator yielding
InfdevChunks. pass nothing for an iterator of every chunk in the level.
the chunks are automatically loaded."""
if chunks is None: chunks = self.allChunks;
return [self.getChunk(cx, cz) for (cx, cz) in chunks if self.containsChunk(cx, cz)]
return (self.getChunk(cx, cz) for (cx, cz) in chunks if self.containsChunk(cx, cz))
def _makeChunk(self, cx, cz):