From 78ce5128fbe0021c9fb9f3db2da392e97654957a Mon Sep 17 00:00:00 2001 From: David Vierra Date: Wed, 16 Sep 2015 04:20:39 -1000 Subject: [PATCH] Add create argument to getChunks --- src/mceditlib/worldeditor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mceditlib/worldeditor.py b/src/mceditlib/worldeditor.py index a46e6dc..f4012a3 100644 --- a/src/mceditlib/worldeditor.py +++ b/src/mceditlib/worldeditor.py @@ -730,7 +730,7 @@ class WorldEditorDimension(object): """ return self.worldEditor.getChunk(cx, cz, self.dimName, create) - def getChunks(self, chunkPositions=None): + def getChunks(self, chunkPositions=None, create=False): """ :type chunkPositions(): iterator :rtype: iterator @@ -738,8 +738,8 @@ class WorldEditorDimension(object): if chunkPositions is None: chunkPositions = self.chunkPositions() for cx, cz in chunkPositions: - if self.containsChunk(cx, cz): - yield self.getChunk(cx, cz) + if self.containsChunk(cx, cz) or create: + yield self.getChunk(cx, cz, create) def createChunk(self, cx, cz): return self.worldEditor.createChunk(cx, cz, self.dimName)