add an iterator version of fillBlocks
This commit is contained in:
parent
e04d9d3ee9
commit
65a70f3bd5
@ -2399,6 +2399,9 @@ class MCInfdevOldLevel(EntityLevel):
|
|||||||
return count;
|
return count;
|
||||||
|
|
||||||
def fillBlocks(self, box, blockInfo, blocksToReplace=[]):
|
def fillBlocks(self, box, blockInfo, blocksToReplace=[]):
|
||||||
|
return exhaust(self.fillBlocksIter(box, blockInfo, blocksToReplace))
|
||||||
|
|
||||||
|
def fillBlocksIter(self, box, blockInfo, blocksToReplace=[]):
|
||||||
if box is None:
|
if box is None:
|
||||||
chunkIterator = self.getAllChunkSlices()
|
chunkIterator = self.getAllChunkSlices()
|
||||||
box = self.bounds
|
box = self.bounds
|
||||||
@ -2437,6 +2440,7 @@ class MCInfdevOldLevel(EntityLevel):
|
|||||||
i += 1;
|
i += 1;
|
||||||
if i % 100 == 0:
|
if i % 100 == 0:
|
||||||
info(u"Chunk {0}...".format(i))
|
info(u"Chunk {0}...".format(i))
|
||||||
|
yield i, box.chunkCount
|
||||||
|
|
||||||
blocks = chunk.Blocks[slices]
|
blocks = chunk.Blocks[slices]
|
||||||
data = chunk.Data[slices]
|
data = chunk.Data[slices]
|
||||||
|
Reference in New Issue
Block a user