From 72dc4374dd1f9758ee6683c5d437a336d8b13cf7 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Thu, 4 Aug 2011 05:17:07 -1000 Subject: [PATCH] change getChunks to return an iterator --- infiniteworld.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/infiniteworld.py b/infiniteworld.py index 7c04912..1c72926 100644 --- a/infiniteworld.py +++ b/infiniteworld.py @@ -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):