From 19d498fd231cd1ba632e9fcb6d3d7dbbb8e9c17c Mon Sep 17 00:00:00 2001 From: David Vierra Date: Fri, 15 Apr 2011 00:02:54 -1000 Subject: [PATCH] fillBlocks now removes tile entities from any blocks that were changed if we wanted to, we could get the indexes out of mask and create them as needed, but eh --- mclevel.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mclevel.py b/mclevel.py index aa4b3e0..c6bb2b0 100644 --- a/mclevel.py +++ b/mclevel.py @@ -3655,15 +3655,25 @@ class MCInfdevOldLevel(MCLevel): else: skipped += 1; needsLighting = False; + + def include(tileEntity): + p = TileEntity.pos(tileEntity) + x,y,z = map(lambda a,b,c:(a-b)-c, p, point, box.origin) + return not ((p in box) and mask[x,z,y]) + + chunk.TileEntities.value[:] = filter(include, chunk.TileEntities) + + else: blocks[:] = blockInfo.ID if not shouldRetainData: data[:] = blockInfo.blockData - + chunk.removeTileEntitiesInBox(box) + chunk.chunkChanged(needsLighting); chunk.compress(); - + if len(blocksToReplace): info( u"Replace: Skipped {0} chunks, replaced {1} blocks".format(skipped, replaced) )